From 14bd6983af036bb07da6ddb075c9b75438d06720 Mon Sep 17 00:00:00 2001 From: Mohammed Diaa Date: Sun, 28 Jul 2024 19:24:02 +0300 Subject: [PATCH] Add release GitHub action --- .github/workflows/release.yaml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 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..211c0ce --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,32 @@ +on: + release: + types: [created] + +jobs: + releases-matrix: + name: Release Go Binary + runs-on: ubuntu-latest + strategy: + matrix: + goos: [linux, darwin] + goarch: ["386", amd64, arm64] + exclude: + - goarch: "386" + goos: darwin + steps: + - name: Get Release Info + run: | + echo "RELEASE_TAG=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV + echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV + echo "OS_NAME=${{ matrix.goos }}" >> $GITHUB_ENV + - name: OS darwin + if: matrix.goos == 'darwin' + run: echo "OS_NAME=macOS" >> $GITHUB_ENV + - uses: actions/checkout@v3 + - uses: wangyoucao577/go-release-action@v1.51 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + asset_name: '${{ env.REPOSITORY_NAME }}_${{ env.RELEASE_TAG }}_${{ env.OS_NAME }}_${{ matrix.goarch }}' + \ No newline at end of file