cloudflare/pint
Publicmirrored fromhttps://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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 26 | with: |
| 27 | show-progress: false |
| 28 | fetch-depth: 0 |
| 29 | |
| 30 | - name: Set up Go |
| 31 | uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 |
| 32 | with: |
| 33 | go-version-file: go.ver |
| 34 | |
| 35 | - name: Set up QEMU |
| 36 | uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 |
| 37 | |
| 38 | - name: Docker Login |
| 39 | uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.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@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 |
| 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@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 |
| 72 | with: |
| 73 | args: release --clean --release-notes=.tmp/changelog.txt |
| 74 | env: |
| 75 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 76 | |