cloudflare/pint
Publicmirrored from https://github.com/cloudflare/pintAvailable
.github/workflows/compile.yml
68lines · 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 | jobs: |
| 17 | build: |
| 18 | runs-on: ubuntu-latest |
| 19 | steps: |
| 20 | - name: Check out code |
| 21 | uses: actions/checkout@v4 |
| 22 | with: |
| 23 | show-progress: false |
| 24 | fetch-depth: 0 |
| 25 | |
| 26 | - name: Set up Go |
| 27 | uses: actions/setup-go@v5 |
| 28 | with: |
| 29 | go-version-file: go.ver |
| 30 | |
| 31 | - name: Set up QEMU |
| 32 | uses: docker/setup-qemu-action@v3 |
| 33 | |
| 34 | - name: Docker Login |
| 35 | uses: docker/login-action@v3 |
| 36 | with: |
| 37 | registry: ghcr.io |
| 38 | username: ${{ github.repository_owner }} |
| 39 | password: ${{ secrets.GITHUB_TOKEN }} |
| 40 | |
| 41 | - name: Test releasing binaries |
| 42 | if: github.event_name == 'pull_request' |
| 43 | uses: goreleaser/goreleaser-action@v5 |
| 44 | with: |
| 45 | args: release --clean --skip=validate --skip=sign --skip=sbom --skip=publish --snapshot |
| 46 | |
| 47 | - name: Extract release changelog |
| 48 | if: startsWith(github.ref, 'refs/tags/') |
| 49 | id: changelog |
| 50 | uses: sean0x42/markdown-extract@v2 |
| 51 | with: |
| 52 | file: docs/changelog.md |
| 53 | pattern: "${{ github.ref_name }}" |
| 54 | no-print-matched-heading: true |
| 55 | |
| 56 | - name: Write changelog |
| 57 | if: startsWith(github.ref, 'refs/tags/') |
| 58 | run: | |
| 59 | mkdir .tmp |
| 60 | printf '${{ steps.changelog.outputs.markdown }}' > .tmp/changelog.txt |
| 61 | |
| 62 | - name: Release binaries |
| 63 | if: startsWith(github.ref, 'refs/tags/') |
| 64 | uses: goreleaser/goreleaser-action@v5 |
| 65 | with: |
| 66 | args: release --clean --release-notes=.tmp/changelog.txt |
| 67 | env: |
| 68 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 69 | |