Skip to content

Commit d07f99e

Browse files
FEATURE: Upload launcher2 to github release on push
Do not use tagged releases. Upload assets to a static release named launcher2.
1 parent c77b530 commit d07f99e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/launcher_go.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,37 @@ jobs:
4343
- name: Run tests
4444
working-directory: ./launcher_go/v2
4545
run: go test ./...
46+
47+
build_release:
48+
if: github.ref == 'refs/heads/main'
49+
permissions:
50+
contents: write
51+
runs-on: ubuntu-latest
52+
needs: [lint, test]
53+
strategy:
54+
matrix:
55+
goos: [linux, darwin]
56+
goarch: ["386", amd64, arm64]
57+
exclude:
58+
- goarch: "386"
59+
goos: darwin
60+
steps:
61+
- uses: actions/checkout@v4
62+
- uses: actions/setup-go@v5
63+
with:
64+
go-version: ">=1.22.0"
65+
- name: build and release
66+
working-directory: ./launcher_go/v2
67+
env:
68+
GH_TOKEN: ${{ github.token }}
69+
GOOS: ${{ matrix.goos }}
70+
GOARCH: ${{ matrix.goarch }}
71+
BIN_FILE: launcher2
72+
ZIP_FILE: launcher2-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
73+
run: |
74+
go build -o bin/${BIN_FILE}
75+
cd bin
76+
tar cvfz ${ZIP_FILE} ${BIN_FILE}
77+
MD5_SUM=$(md5sum ${ZIP_FILE} | cut -d ' ' -f 1)
78+
echo ${MD5_SUM} > ${ZIP_FILE}.md5
79+
gh release upload --clobber launcher2 ${ZIP_FILE} ${ZIP_FILE}.md5

0 commit comments

Comments
 (0)