cloudflare/pint
Publicmirrored from https://github.com/cloudflare/pintAvailable
.github/workflows/compile.yml
51lines · 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: Set up Go |
| 21 | uses: actions/setup-go@v3 |
| 22 | with: |
| 23 | go-version: 1.18.2 |
| 24 | |
| 25 | - name: Check out code |
| 26 | uses: actions/checkout@v3 |
| 27 | with: |
| 28 | fetch-depth: 0 |
| 29 | |
| 30 | - name: Set up QEMU |
| 31 | uses: docker/setup-qemu-action@v2 |
| 32 | |
| 33 | - name: Docker Login |
| 34 | uses: docker/login-action@v2 |
| 35 | with: |
| 36 | registry: ghcr.io |
| 37 | username: ${{ github.repository_owner }} |
| 38 | password: ${{ secrets.GITHUB_TOKEN }} |
| 39 | |
| 40 | - name: Compile binaries |
| 41 | uses: goreleaser/goreleaser-action@v2 |
| 42 | with: |
| 43 | args: build --snapshot --rm-dist |
| 44 | |
| 45 | - name: Release binaries |
| 46 | if: startsWith(github.ref, 'refs/tags/') |
| 47 | uses: goreleaser/goreleaser-action@v2 |
| 48 | with: |
| 49 | args: release --rm-dist |
| 50 | env: |
| 51 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 52 | |