chore: migrate from gomodguard to gomodguard_v2 (#10739) #1975
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: Canary build | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| paths: | |
| - '**.go' | |
| - 'go.mod' | |
| - 'Dockerfile.canary' | |
| - '.github/workflows/canary.yaml' | |
| workflow_dispatch: | |
| jobs: | |
| build-binaries: | |
| name: Build binaries | |
| uses: ./.github/workflows/reusable-release.yaml | |
| with: | |
| goreleaser_config: goreleaser-canary.yml | |
| goreleaser_options: '--snapshot --clean --timeout 60m' # will not release | |
| secrets: | |
| DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }} | |
| DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
| ECR_ACCESS_KEY_ID: ${{ secrets.ECR_ACCESS_KEY_ID }} | |
| ECR_SECRET_ACCESS_KEY: ${{ secrets.ECR_SECRET_ACCESS_KEY }} | |
| GPG_KEY: ${{ secrets.GPG_KEY }} | |
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| upload-binaries: | |
| name: Upload binaries | |
| needs: build-binaries # run this job after 'build-binaries' job completes | |
| runs-on: ubuntu-2404-2core | |
| permissions: | |
| actions: write # Required to delete caches | |
| steps: | |
| - name: Restore Trivy binaries from cache | |
| uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 | |
| with: | |
| path: dist/ | |
| key: ${{ runner.os }}-bins-${{ github.workflow }}-${{ github.sha }} | |
| # Upload artifacts | |
| - name: Upload artifacts (trivy_Linux-64bit) | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: trivy_Linux-64bit | |
| path: dist/trivy_*_Linux-64bit.tar.gz | |
| if-no-files-found: error | |
| - name: Upload artifacts (trivy_Linux-ARM64) | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: trivy_Linux-ARM64 | |
| path: dist/trivy_*_Linux-ARM64.tar.gz | |
| if-no-files-found: error | |
| - name: Upload artifacts (trivy_macOS-64bit) | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: trivy_macOS-64bit | |
| path: dist/trivy_*_macOS-64bit.tar.gz | |
| if-no-files-found: error | |
| - name: Upload artifacts (trivy_macOS-ARM64) | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: trivy_macOS-ARM64 | |
| path: dist/trivy_*_macOS-ARM64.tar.gz | |
| if-no-files-found: error | |
| - name: Delete cache after upload | |
| run: | | |
| gh cache delete "$CACHE_KEY" --repo "${{ github.repository }}" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CACHE_KEY: ${{ runner.os }}-bins-${{ github.workflow }}-${{ github.sha }} |