From 33e40e88652f8e9d653ec0ed2ebdcd19eeab460d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastien=20Cl=C3=A9ment?= Date: Sat, 4 Nov 2023 14:03:14 +0100 Subject: [PATCH] Client release workflow --- .github/workflows/release.yaml | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..91402d6 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,37 @@ +name: Release +on: + push: + tags: + - '*' + +permissions: + contents: write + +jobs: + deploy: + name: Build and release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '1.21.x' + + - name: Build + env: + CGO_ENABLED: "0" + GO111MODULE: "on" + run: | + GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w -X main.version=${{ github.ref }} -X main.commit=${{ github.sha }}" -o bin/alfred-linux-amd64 ./client + GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags="-s -w -X main.version=${{ github.ref }} -X main.commit=${{ github.sha }}" -o bin/alfred-darwin-amd64 ./client + GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags="-s -w -X main.version=${{ github.ref }} -X main.commit=${{ github.sha }}" -o bin/alfred-darwin-arm64 ./client + + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v2 + with: + file: bin/alfred-* + file_glob: true + overwrite: true + promote: true \ No newline at end of file