From e508e8d9672026ff09cb88f7d6ccc67364945a9c Mon Sep 17 00:00:00 2001 From: Pieter Hollander Date: Wed, 21 Feb 2024 19:02:51 +0100 Subject: [PATCH] Add go package build workflow. --- .gitea/workflows/go.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .gitea/workflows/go.yml diff --git a/.gitea/workflows/go.yml b/.gitea/workflows/go.yml new file mode 100644 index 0000000..4c0c6f2 --- /dev/null +++ b/.gitea/workflows/go.yml @@ -0,0 +1,38 @@ +name: release + +on: + push: + tags: + - '*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: setup go + uses: https://github.com/actions/setup-go@v4 + with: + go-version: '>=1.x' + - name: release-build-linux-amd64 + run: GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/reverse-${{ github.ref_name }}-linux-amd64 + - name: release-build-linux-arm64 + run: GOOS=linux GOARCH=arm64 go build -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/reverse-${{ github.ref_name }}-linux-arm64 + - name: release-build-windows-amd64 + run: GOOS=windows GOARCH=amd64 go build -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/reverse-${{ github.ref_name }}-windows-amd64.exe + - name: release-build-windows-arm64 + run: GOOS=windows GOARCH=arm64 go build -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/reverse-${{ github.ref_name }}-windows-arm64.exe + - name: release-build-darwin-amd64 + run: GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/reverse-${{ github.ref_name }}-darwin-amd64 + - name: release-build-darwin-arm64 + run: GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/reverse-${{ github.ref_name }}-darwin-arm64 + + - name: Use Go Action + id: use-go-action + uses: actions/release-action@main + with: + files: |- + bin/** + api_key: '${{secrets.RELEASE_TOKEN}}'