-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (77 loc) · 2.71 KB
/
Copy pathrelease.yml
File metadata and controls
91 lines (77 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Release
on:
push:
tags:
- 'v*'
branches:
- main
jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.25.0'
- run: go version
- name: Get version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Build for Linux AMD64
run: |
GOOS=linux GOARCH=amd64 CGO_ENABLE=0 go build \
-ldflags "-s -w -X github.com/LinPr/s6cmd/version.Version=${{ steps.get_version.outputs.VERSION }}" \
-o s6cmd-linux-amd64 .
- name: Build for Linux ARM64
run: |
GOOS=linux GOARCH=arm64 CGO_ENABLE=0 go build \
-ldflags "-s -w -X github.com/LinPr/s6cmd/version.Version=${{ steps.get_version.outputs.VERSION }}" \
-o s6cmd-linux-arm64 .
- name: Build for Windows AMD64
run: |
GOOS=windows GOARCH=amd64 CGO_ENABLE=0 go build \
-ldflags "-s -w -X github.com/LinPr/s6cmd/version.Version=${{ steps.get_version.outputs.VERSION }}" \
-o s6cmd-windows-amd64.exe .
- name: Build for Windows ARM64
run: |
GOOS=windows GOARCH=arm64 CGO_ENABLE=0 go build \
-ldflags "-s -w -X github.com/LinPr/s6cmd/version.Version=${{ steps.get_version.outputs.VERSION }}" \
-o s6cmd-windows-arm64.exe .
- name: Build for macOS AMD64
run: |
GOOS=darwin GOARCH=amd64 CGO_ENABLE=0 go build \
-ldflags "-s -w -X github.com/LinPr/s6cmd/version.Version=${{ steps.get_version.outputs.VERSION }}" \
-o s6cmd-darwin-amd64 .
- name: Build for macOS ARM64
run: |
GOOS=darwin GOARCH=arm64 CGO_ENABLE=0 go build \
-ldflags "-s -w -X github.com/LinPr/s6cmd/version.Version=${{ steps.get_version.outputs.VERSION }}" \
-o s6cmd-darwin-arm64 .
- name: Create checksums
run: |
sha256sum s6cmd-* > checksums.txt
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
name: Release ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: true # s6cmd is pre-1.0; mark releases as prerelease
generate_release_notes: true
files: |
s6cmd-linux-amd64
s6cmd-linux-arm64
s6cmd-windows-amd64.exe
s6cmd-windows-arm64.exe
s6cmd-darwin-amd64
s6cmd-darwin-arm64
checksums.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}