Repository navigation
chore: update GitHub Action task versions #280
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: Go | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| checks: write | |
| contents: write | |
| packages: write | |
| pull-requests: write | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: [ ubuntu-latest, macos-latest, windows-latest ] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: "0" | |
| fetch-tags: "true" | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: go.sum | |
| check-latest: true | |
| - name: Init go | |
| run: | | |
| go mod download | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| env: | |
| GOPROXY: direct | |
| - id: govulncheck | |
| uses: golang/govulncheck-action@v1 | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| with: | |
| go-version-file: go.mod | |
| go-package: ./... | |
| - name: Test | |
| run: | | |
| go tool gotestsum --format pkgname --junitfile out/junit.xml -- -race -shuffle=on -covermode=atomic ./... | |
| - name: Test Report | |
| uses: dorny/test-reporter@v3 | |
| if: success() || failure() | |
| with: | |
| name: git-age@${{ matrix.os }} | |
| path: out/junit.xml | |
| reporter: java-junit | |
| deploy: | |
| environment: github | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: "0" | |
| fetch-tags: "true" | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: go.sum | |
| check-latest: true | |
| - name: Init go | |
| run: | | |
| go mod download | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "4.0.2" | |
| bundler-cache: true | |
| - run: gem install asciidoctor | |
| - name: Setup Syft | |
| run: curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin | |
| - name: Prepare GPG setup | |
| run: | | |
| mkdir -p $GITHUB_WORKSPACE/.gnupg | |
| echo "${{ secrets.GPG_SIGNING_KEY }}" | base64 -d > $GITHUB_WORKSPACE/.gnupg/gpg.key | |
| - name: Snapshot release | |
| uses: goreleaser/goreleaser-action@v7 | |
| if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | |
| with: | |
| distribution: goreleaser | |
| version: latest | |
| args: release --clean --snapshot | |
| env: | |
| NFPM_PASSPHRASE: ${{ secrets.NFPM_PASSPHRASE }} | |
| - name: Release | |
| uses: goreleaser/goreleaser-action@v7 | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| with: | |
| distribution: goreleaser | |
| version: latest | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_TAP_PAT: ${{ secrets.GH_TAP_PAT }} | |
| GH_WINGET_PAT: ${{ secrets.GH_WINGET_PAT }} | |
| GH_SCOOP_PAT: ${{ secrets.GH_SCOOP_PAT }} | |
| AUR_KEY: ${{ secrets.AUR_SSH_KEY }} | |
| NFPM_PASSPHRASE: ${{ secrets.NFPM_PASSPHRASE }} | |
| - name: Upload RPM packages | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| run: | | |
| for rpm in dist/*.rpm; do | |
| curl --user prskr:${{ secrets.UPLOAD_RPM_SECRET }} \ | |
| --upload-file "${rpm}" \ | |
| https://code.icb4dc0.de/api/packages/prskr/rpm/upload | |
| done | |
| - name: Upload DEB packages | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| run: | | |
| for deb in dist/*.deb; do | |
| curl --user prskr:${{ secrets.UPLOAD_DEB_SECRET }} \ | |
| --upload-file "${deb}" \ | |
| https://code.icb4dc0.de/api/packages/prskr/debian/pool/bookworm/main/upload | |
| done |