cloudflare/pint
Publicmirrored from https://github.com/cloudflare/pintAvailable
.github/workflows/compile.yml
75lines · modecode
| 1 | name: Compile |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - main |
| 7 | tags: |
| 8 | - "*" |
| 9 | pull_request: |
| 10 | branches: |
| 11 | - main |
| 12 | release: |
| 13 | types: |
| 14 | - published |
| 15 | |
| 16 | permissions: |
| 17 | contents: write |
| 18 | packages: write |
| 19 | |
| 20 | jobs: |
| 21 | build: |
| 22 | runs-on: ubuntu-latest |
| 23 | steps: |
| 24 | - name: Check out code |
| 25 | uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 26 | with: |
| 27 | show-progress: false |
| 28 | fetch-depth: 0 |
| 29 | |
| 30 | - name: Set up Go |
| 31 | uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 |
| 32 | with: |
| 33 | go-version-file: go.ver |
| 34 | |
| 35 | - name: Set up QEMU |
| 36 | uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0 |
| 37 | |
| 38 | - name: Docker Login |
| 39 | uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 |
| 40 | with: |
| 41 | registry: ghcr.io |
| 42 | username: ${{ github.repository_owner }} |
| 43 | password: ${{ secrets.GITHUB_TOKEN }} |
| 44 | |
| 45 | - name: Test releasing binaries |
| 46 | if: github.event_name == 'pull_request' |
| 47 | uses: goreleaser/goreleaser-action@5daf1e915a5f0af01ddbcd89a43b8061ff4f1a89 # v7.2.2 |
| 48 | with: |
| 49 | args: release --clean --skip=validate --skip=sign --skip=sbom --skip=publish --snapshot |
| 50 | |
| 51 | - name: Extract release changelog |
| 52 | if: startsWith(github.ref, 'refs/tags/') |
| 53 | id: changelog |
| 54 | uses: sean0x42/markdown-extract@4178293dd16a52514b6cb2c01f4d309d264b2736 # v2 |
| 55 | with: |
| 56 | file: docs/changelog.md |
| 57 | pattern: "${{ github.ref_name }}" |
| 58 | no-print-matched-heading: true |
| 59 | |
| 60 | - name: Write changelog |
| 61 | if: startsWith(github.ref, 'refs/tags/') |
| 62 | run: | |
| 63 | mkdir .tmp |
| 64 | exec 3<<'HERE' |
| 65 | ${{ steps.changelog.outputs.markdown }} |
| 66 | HERE |
| 67 | cat /dev/fd/3 | tee .tmp/changelog.txt |
| 68 | |
| 69 | - name: Release binaries |
| 70 | if: startsWith(github.ref, 'refs/tags/') |
| 71 | uses: goreleaser/goreleaser-action@5daf1e915a5f0af01ddbcd89a43b8061ff4f1a89 # v7.2.2 |
| 72 | with: |
| 73 | args: release --clean --release-notes=.tmp/changelog.txt |
| 74 | env: |
| 75 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 76 | |