From 30e5abca6dcbe7181056b9a4227cf72f8cc67548 Mon Sep 17 00:00:00 2001 From: Jeff Wong Date: Thu, 7 Nov 2024 15:33:58 -0800 Subject: [PATCH] FEATURE: Upload launcher2 to github release on push Do not use tagged releases. Upload assets to a static release named launcher2. --- .github/workflows/launcher_go.yml | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/workflows/launcher_go.yml b/.github/workflows/launcher_go.yml index fa238315e..55a64fae8 100644 --- a/.github/workflows/launcher_go.yml +++ b/.github/workflows/launcher_go.yml @@ -43,3 +43,37 @@ jobs: - name: Run tests working-directory: ./launcher_go/v2 run: go test ./... + + build_release: + if: github.ref == 'refs/heads/main' + permissions: + contents: write + runs-on: ubuntu-latest + needs: [lint, test] + strategy: + matrix: + goos: [linux, darwin] + goarch: ["386", amd64, arm64] + exclude: + - goarch: "386" + goos: darwin + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: ">=1.22.0" + - name: build and release + working-directory: ./launcher_go/v2 + env: + GH_TOKEN: ${{ github.token }} + GOOS: ${{ matrix.goos }} + GOARCH: ${{ matrix.goarch }} + BIN_FILE: launcher2 + ZIP_FILE: launcher2-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz + run: | + go build -o bin/${BIN_FILE} + cd bin + tar cvfz ${ZIP_FILE} ${BIN_FILE} + MD5_SUM=$(md5sum ${ZIP_FILE} | cut -d ' ' -f 1) + echo ${MD5_SUM} > ${ZIP_FILE}.md5 + gh release upload --clobber launcher ${ZIP_FILE} ${ZIP_FILE}.md5