From b459d6395c4f295492d0221365b9292215b1eb7b Mon Sep 17 00:00:00 2001 From: Sultan Iman <354868+sultaniman@users.noreply.github.com> Date: Fri, 21 Jun 2024 16:42:52 +0200 Subject: [PATCH] Update release.yml --- .github/workflows/release.yml | 104 +++++++++------------------------- 1 file changed, 26 insertions(+), 78 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 60ab306..71b0156 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,81 +1,29 @@ -on: release -name: Build Release +on: + release: + types: [created] + +permissions: + contents: write + packages: write + jobs: - release-linux-386: - name: release linux/386 + releases-matrix: + name: Release Binary runs-on: ubuntu-latest + strategy: + matrix: + goos: [linux, windows, darwin] + goarch: ["386", amd64, arm64] + exclude: + - goarch: "386" + goos: darwin steps: - - uses: actions/checkout@master - - name: compile and release - uses: ngs/go-release.action@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GOARCH: "386" - GOOS: linux - release-linux-amd64: - name: release linux/amd64 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: compile and release - uses: ngs/go-release.action@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GOARCH: amd64 - GOOS: linux - EXTRA_FILES: "LICENSE" - release-linux-arm: - name: release linux/arm - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: compile and release - uses: ngs/go-release.action@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GOARCH: "arm" - GOOS: linux - release-linux-arm64: - name: release linux/arm64 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: compile and release - uses: ngs/go-release.action@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GOARCH: arm64 - GOOS: linux - release-darwin-amd64: - name: release darwin/amd64 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: compile and release - uses: ngs/go-release.action@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GOARCH: amd64 - GOOS: darwin - release-windows-386: - name: release windows/386 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: compile and release - uses: ngs/go-release.action@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GOARCH: "386" - GOOS: windows - release-windows-amd64: - name: release windows/amd64 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: compile and release - uses: ngs/go-release.action@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GOARCH: amd64 - GOOS: windows + - uses: actions/checkout@v4 + - uses: wangyoucao577/go-release-action@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + goversion: "https://dl.google.com/go/go1.22.4.linux-amd64.tar.gz" + binary_name: "pwc" + extra_files: README.md