From fd16f1b4116a829046a7dc3bf1dc698cee5bb5a8 Mon Sep 17 00:00:00 2001 From: King'ori Maina Date: Wed, 20 Nov 2024 12:35:28 +0200 Subject: [PATCH] Add release workflow --- .github/workflows/release.yml | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..17f7564 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: release + +on: + push: + tags: + - "[0-9].[0-9]+.[0-9]+" + +jobs: + github-release: + runs-on: ubuntu-latest + steps: + - name: Create Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref_name }} + release_name: Version ${{ github.ref_name }} + draft: false + prerelease: false + + release-binaries: + runs-on: ubuntu-latest + needs: github-release + strategy: + matrix: + goos: + - linux + - darwin + - windows + goarch: + - amd64 + - arm64 + exclude: + - goarch: arm64 + goos: windows + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Publish Go Binaries + uses: wangyoucao577/go-release-action@v1.52 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + ldflags: -X "main.tagVersion=${{ github.ref_name }}" + extra_files: LICENSE README.md + md5sum: true + sha256sum: true + asset_name: resque-exporter-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix.goarch }}