v0.13.3 #41
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: release | |
| on: | |
| release: | |
| types: [published] | |
| env: | |
| GO_VERSION: "1.25.5" | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| env: | |
| ASSET: "" | |
| BIN_NAME: fetch | |
| strategy: | |
| matrix: | |
| build: | |
| - linux-amd64 | |
| - linux-arm64 | |
| - darwin-amd64 | |
| - darwin-arm64 | |
| - windows-amd64 | |
| - windows-arm64 | |
| include: | |
| - build: linux-amd64 | |
| goos: linux | |
| goarch: amd64 | |
| - build: linux-arm64 | |
| goos: linux | |
| goarch: arm64 | |
| - build: darwin-amd64 | |
| goos: darwin | |
| goarch: amd64 | |
| - build: darwin-arm64 | |
| goos: darwin | |
| goarch: arm64 | |
| - build: windows-amd64 | |
| goos: windows | |
| goarch: amd64 | |
| - build: windows-arm64 | |
| goos: windows | |
| goarch: arm64 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Set bin name | |
| if: ${{ matrix.goos == 'windows' }} | |
| run: echo "BIN_NAME=fetch.exe" >> $GITHUB_ENV | |
| - name: Go build | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| CGO_ENABLED: "0" | |
| run: go build -trimpath -ldflags="-s -w -buildid=" -o ${{ env.BIN_NAME }} | |
| - name: Build archive (unix) | |
| if: ${{ matrix.goos != 'windows' }} | |
| shell: bash | |
| run: | | |
| staging="fetch-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix.goarch }}" | |
| tar czf "$staging.tar.gz" fetch | |
| echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV | |
| - name: Build archive (windows) | |
| if: ${{ matrix.goos == 'windows' }} | |
| shell: bash | |
| run: | | |
| staging="fetch-${{ github.ref_name }}-${{ matrix.goos }}-${{ matrix.goarch }}" | |
| zip "$staging.zip" fetch.exe | |
| echo "ASSET=$staging.zip" >> $GITHUB_ENV | |
| - name: Upload release archive | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: gh release upload ${{ github.ref_name }} ${{ env.ASSET }} | |
| latest: | |
| runs-on: "ubuntu-latest" | |
| needs: release | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Mark release as latest | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release edit ${{ github.ref_name }} --prerelease=false | |
| gh release edit ${{ github.ref_name }} --latest |