debug pipeline #9
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: GoReleaser Debug | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| ldflags_args: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| commit-date: ${{ steps.ldflags.outputs.commit-date }} | |
| commit: ${{ steps.ldflags.outputs.commit }} | |
| version: ${{ steps.ldflags.outputs.version }} | |
| tree-state: ${{ steps.ldflags.outputs.tree-state }} | |
| steps: | |
| - id: checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - id: ldflags | |
| run: | | |
| echo "commit=$GITHUB_SHA" >> $GITHUB_OUTPUT | |
| echo "commit-date=$(git log --date=iso8601-strict -1 --pretty=%ct)" >> $GITHUB_OUTPUT | |
| echo "version=$(git describe --tags --always --dirty | cut -c2-)" >> $GITHUB_OUTPUT | |
| echo "tree-state=$(if git diff --quiet; then echo "clean"; else echo "dirty"; fi)" >> $GITHUB_OUTPUT | |
| goreleaser-test: | |
| name: Test GoReleaser Build | |
| needs: | |
| - ldflags_args | |
| permissions: | |
| contents: write # To add assets to a release. | |
| id-token: write # To do keyless signing with cosign | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Install Syft | |
| uses: anchore/sbom-action/download-syft@7b36ad622f042cab6f59a75c2ac24ccb256e9b45 # v0.20.4 | |
| - name: Install Cosign | |
| uses: sigstore/cosign-installer@v3.9.2 | |
| - name: Test GoReleaser Build (Darwin only) | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| distribution: goreleaser | |
| version: latest | |
| args: release --verbose --snapshot --clean --fail-fast --config .goreleaser-debug.yaml | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} | |
| VERSION: ${{ needs.ldflags_args.outputs.version }} | |
| COMMIT: ${{ needs.ldflags_args.outputs.commit }} | |
| COMMIT_DATE: ${{ needs.ldflags_args.outputs.commit-date }} | |
| TREE_STATE: ${{ needs.ldflags_args.outputs.tree-state }} | |
| GOPROXY: https://proxy.golang.org,direct |