build(deps): bump actions/upload-artifact from 4.6.2 to 5.0.0 #234
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: "azqr-build" | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths-ignore: | |
| - docs/** | |
| branches: | |
| - main | |
| - release-* | |
| - feature-* | |
| tags: | |
| - v* | |
| pull_request: | |
| paths-ignore: | |
| - docs/** | |
| branches: | |
| - main | |
| - release-* | |
| permissions: read-all | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| submodules: "recursive" | |
| - name: Set up Go | |
| uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
| with: | |
| go-version-file: "go.mod" | |
| cache: true | |
| - name: Run tests | |
| run: make test | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 | |
| calculate-version: | |
| name: Calculate Version | |
| runs-on: ubuntu-latest | |
| needs: test | |
| outputs: | |
| version: ${{ steps.calculate_version.outputs.version }} | |
| steps: | |
| - name: Check out code into the Go module directory | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: Calculate Version | |
| id: calculate_version | |
| run: | | |
| echo "version=$(git describe --tags)" >> $GITHUB_OUTPUT | |
| build-linux: | |
| name: Build Linux Binaries | |
| runs-on: ubuntu-latest | |
| needs: calculate-version | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - name: Check out code into the Go module directory | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| submodules: "recursive" | |
| - name: Set up Go | |
| uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
| with: | |
| go-version-file: "go.mod" | |
| cache: true | |
| - name: Build JSON data | |
| run: make json | |
| - name: Build Linux AMD64 | |
| run: make | |
| env: | |
| GOOS: linux | |
| GOARCH: amd64 | |
| CGO_ENABLED: 0 | |
| PRODUCT_VERSION: ${{ needs.calculate-version.outputs.version }} | |
| - name: Build Linux ARM64 | |
| run: make | |
| env: | |
| GOOS: linux | |
| GOARCH: arm64 | |
| CGO_ENABLED: 0 | |
| PRODUCT_VERSION: ${{ needs.calculate-version.outputs.version }} | |
| - name: tarball Linux binaries | |
| run: | | |
| tar -czf linux-azqr.tar.gz bin/linux_* | |
| - name: Upload Linux artifacts | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: linux-binaries | |
| path: linux-azqr.tar.gz | |
| build-windows: | |
| name: Build Windows Binaries | |
| runs-on: windows-latest | |
| needs: calculate-version | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - name: Check out code into the Go module directory | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| submodules: "recursive" | |
| - name: Set up Go | |
| uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
| with: | |
| go-version-file: "go.mod" | |
| cache: true | |
| - name: Build Windows AMD64 | |
| run: make | |
| env: | |
| GOOS: windows | |
| GOARCH: amd64 | |
| CGO_ENABLED: 0 | |
| PRODUCT_VERSION: ${{ needs.calculate-version.outputs.version }} | |
| - name: Build Windows ARM64 | |
| run: make | |
| env: | |
| GOOS: windows | |
| GOARCH: arm64 | |
| CGO_ENABLED: 0 | |
| PRODUCT_VERSION: ${{ needs.calculate-version.outputs.version }} | |
| - name: Copy README and LICENSE | |
| run: | | |
| copy README.md bin\windows_amd64\README.md | |
| copy LICENSE bin\windows_amd64\LICENSE | |
| copy README.md bin\windows_arm64\README.md | |
| copy LICENSE bin\windows_arm64\LICENSE | |
| - name: tarball windows binaries | |
| run: | | |
| tar -czf windows-azqr.tar.gz bin/windows_* | |
| - name: Upload Windows artifacts | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: windows-binaries | |
| path: windows-azqr.tar.gz | |
| build-macos: | |
| name: Build macOS Binaries | |
| runs-on: macos-latest | |
| needs: calculate-version | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - name: Check out code into the Go module directory | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| submodules: "recursive" | |
| - name: Set up Go | |
| uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
| with: | |
| go-version-file: "go.mod" | |
| cache: true | |
| - name: Build macOS AMD64 | |
| run: make | |
| env: | |
| GOOS: darwin | |
| GOARCH: amd64 | |
| CGO_ENABLED: 1 | |
| PRODUCT_VERSION: ${{ needs.calculate-version.outputs.version }} | |
| - name: Build macOS ARM64 | |
| run: make | |
| env: | |
| GOOS: darwin | |
| GOARCH: arm64 | |
| CGO_ENABLED: 1 | |
| PRODUCT_VERSION: ${{ needs.calculate-version.outputs.version }} | |
| - name: tarball macos binaries | |
| run: | | |
| tar -czf macos-azqr.tar.gz bin/darwin_* | |
| - name: Upload macOS artifacts | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: macos-binaries | |
| path: macos-azqr.tar.gz | |
| release: | |
| name: Create Release | |
| needs: [calculate-version, build-linux, build-windows, build-macos] | |
| if: github.event_name != 'pull_request' && startswith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| outputs: | |
| release_id: ${{ steps.create_release.outputs.id }} | |
| steps: | |
| - name: Create azqr Release | |
| id: create_release | |
| uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2.4.1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| name: ${{ needs.calculate-version.outputs.version }} | |
| body: "" | |
| draft: false | |
| publish: | |
| name: Publish binaries | |
| needs: [release] | |
| permissions: | |
| contents: write | |
| if: github.event_name != 'pull_request' && startswith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | |
| with: | |
| path: bin | |
| - name: untar binaries | |
| run: | | |
| tar -xzf bin/linux-binaries/linux-azqr.tar.gz | |
| tar -xzf bin/macos-binaries/macos-azqr.tar.gz | |
| tar -xzf bin/windows-binaries/windows-azqr.tar.gz | |
| - name: Move binaries to correct locations | |
| run: | | |
| mkdir -p bin/linux_amd64 bin/linux_arm64 bin/linux_armv7 \ | |
| bin/darwin_amd64 bin/darwin_arm64 \ | |
| bin/windows_amd64 bin/windows_arm64 | |
| rm -rf bin/linux-binaries bin/macos-binaries bin/windows-binaries | |
| - name: Zip | |
| uses: montudor/action-zip@a8e75c9faefcd80fac3baf53ef40b9b119d5b702 # v1 | |
| with: | |
| args: zip -qq -r azqr.zip bin | |
| - name: Zip (win-amd64) | |
| uses: montudor/action-zip@a8e75c9faefcd80fac3baf53ef40b9b119d5b702 # v1 | |
| with: | |
| args: zip -qq azqr-win-amd64.zip bin/windows_amd64/azqr.exe bin/windows_amd64/README.md bin/windows_amd64/LICENSE | |
| - name: Zip (win-arm64) | |
| uses: montudor/action-zip@a8e75c9faefcd80fac3baf53ef40b9b119d5b702 # v1 | |
| with: | |
| args: zip -qq azqr-win-arm64.zip bin/windows_arm64/azqr.exe bin/windows_arm64/README.md bin/windows_arm64/LICENSE | |
| - name: Zip (darwin-amd64) | |
| uses: montudor/action-zip@a8e75c9faefcd80fac3baf53ef40b9b119d5b702 # v1 | |
| with: | |
| args: zip -qq azqr-darwin-amd64.zip bin/darwin_amd64/azqr | |
| - name: Zip (darwin-arm64) | |
| uses: montudor/action-zip@a8e75c9faefcd80fac3baf53ef40b9b119d5b702 # v1 | |
| with: | |
| args: zip -qq azqr-darwin-arm64.zip bin/darwin_arm64/azqr | |
| - name: Zip (linux-amd64) | |
| uses: montudor/action-zip@a8e75c9faefcd80fac3baf53ef40b9b119d5b702 # v1 | |
| with: | |
| args: zip -qq azqr-linux-amd64.zip bin/linux_amd64/azqr | |
| - name: Zip (linux-arm64) | |
| uses: montudor/action-zip@a8e75c9faefcd80fac3baf53ef40b9b119d5b702 # v1 | |
| with: | |
| args: zip -qq azqr-linux-arm64.zip bin/linux_arm64/azqr | |
| - name: Create sha256 Checksums | |
| run: | | |
| sha256sum azqr.zip > azqr.zip.sha256 | |
| sha256sum azqr-win-amd64.zip > azqr-win-amd64.zip.sha256 | |
| sha256sum azqr-win-arm64.zip > azqr-win-arm64.zip.sha256 | |
| sha256sum azqr-darwin-amd64.zip > azqr-darwin-amd64.zip.sha256 | |
| sha256sum azqr-darwin-arm64.zip > azqr-darwin-arm64.zip.sha256 | |
| sha256sum azqr-linux-amd64.zip > azqr-linux-amd64.zip.sha256 | |
| sha256sum azqr-linux-arm64.zip > azqr-linux-arm64.zip.sha256 | |
| - name: Publish | |
| uses: skx/github-action-publish-binaries@44887b225ceca96efd8a912d39c09ad70312af31 # master | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| args: azqr.zip azqr-win-amd64.zip azqr-win-arm64.zip azqr-darwin-amd64.zip azqr-darwin-arm64.zip azqr-linux-amd64.zip azqr-linux-arm64.zip azqr.zip.sha256 azqr-win-amd64.zip.sha256 azqr-win-arm64.zip.sha256 azqr-darwin-amd64.zip.sha256 azqr-darwin-arm64.zip.sha256 azqr-linux-amd64.zip.sha256 azqr-linux-arm64.zip.sha256 | |
| releaseId: ${{ needs.release.outputs.release_id }} | |
| bump-winget: | |
| name: bump-winget | |
| needs: [calculate-version, publish] | |
| permissions: | |
| contents: write | |
| if: github.event_name != 'pull_request' && startswith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Trigger Bump Winget | |
| uses: peter-evans/repository-dispatch@5fc4efd1a4797ddb68ffd0714a238564e4cc0e6f # v4.0.0 | |
| with: | |
| event-type: bump-winget | |
| client-payload: '{"version": "${{ needs.calculate-version.outputs.version }}"}' |