Skip to content

Commit ff60565

Browse files
upload launcher2 to github release on tag creation
create release on tag push of type v*.*.*
1 parent 1ae67ef commit ff60565

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/launcher_go.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: launcher_go
22

33
on:
44
push:
5+
tags:
6+
- "v*.*.*"
57
branches:
68
- main
79
paths:
@@ -43,3 +45,41 @@ jobs:
4345
- name: Run tests
4446
working-directory: ./launcher_go/v2
4547
run: go test ./...
48+
49+
build_release:
50+
if: startsWith(github.ref, 'refs/tags/')
51+
permissions:
52+
contents: write
53+
runs-on: ubuntu-latest
54+
needs: [lint, test]
55+
strategy:
56+
matrix:
57+
goos: [linux, darwin]
58+
goarch: ["386", amd64, arm64]
59+
exclude:
60+
- goarch: "386"
61+
goos: darwin
62+
steps:
63+
- uses: actions/checkout@v4
64+
- uses: actions/setup-go@v5
65+
with:
66+
go-version: ">=1.22.0"
67+
- name: build
68+
working-directory: ./launcher_go/v2
69+
env:
70+
GOOS: ${{ matrix.goos }}
71+
GOARCH: ${{ matrix.goarch }}
72+
BIN_FILE: launcher2
73+
ZIP_FILE: launcher2-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
74+
run: |
75+
go build -o bin/${BIN_FILE}
76+
cd bin
77+
tar cvfz ${ZIP_FILE} ${BIN_FILE}
78+
MD5_SUM=$(md5sum ${ZIP_FILE} | cut -d ' ' -f 1)
79+
echo ${MD5_SUM} > ${ZIP_FILE}.md5
80+
- name: Release
81+
uses: softprops/action-gh-release@v2
82+
with:
83+
files: |
84+
./launcher_go/v2/bin/launcher2-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
85+
./launcher_go/v2/bin/launcher2-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz.md5

0 commit comments

Comments
 (0)