|
| 1 | +# Continuous integration handling for GoReleaser |
| 2 | +name: GoReleaser CI |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + pull_request: |
| 9 | + paths: |
| 10 | + - .github/workflows/goreleaser-ci.yml |
| 11 | + - .goreleaser.yml |
| 12 | + - .go-version |
| 13 | + - go.sum |
| 14 | + - main.go |
| 15 | + - internal/** |
| 16 | + - tools/** |
| 17 | + |
| 18 | +jobs: |
| 19 | + changes: |
| 20 | + runs-on: ubuntu-latest |
| 21 | + outputs: |
| 22 | + goreleaser: ${{ steps.filter.outputs.goreleaser }} |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v3 |
| 25 | + - uses: dorny/paths-filter@v2 |
| 26 | + id: filter |
| 27 | + with: |
| 28 | + filters: | |
| 29 | + goreleaser: |
| 30 | + - '.github/workflows/goreleaser-ci.yml' |
| 31 | + - '.goreleaser.yml' |
| 32 | + check: |
| 33 | + needs: changes |
| 34 | + if: ${{ needs.changes.outputs.goreleaser == 'true' }} |
| 35 | + runs-on: ubuntu-latest |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v3 |
| 38 | + - uses: actions/setup-go@v3 |
| 39 | + with: |
| 40 | + go-version-file: go.mod |
| 41 | + - uses: actions/cache@v2 |
| 42 | + continue-on-error: true |
| 43 | + timeout-minutes: 2 |
| 44 | + with: |
| 45 | + path: ~/go/pkg/mod |
| 46 | + key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} |
| 47 | + - name: goreleaser check |
| 48 | + uses: goreleaser/goreleaser-action@v2 |
| 49 | + with: |
| 50 | + args: check |
| 51 | + build-32-bit: |
| 52 | + # Run a single compiler check for 32-bit architecture (FreeBSD/ARM) |
| 53 | + # Ref: https://github.com/hashicorp/terraform-provider-awscc/issues/533 |
| 54 | + runs-on: ubuntu-latest |
| 55 | + steps: |
| 56 | + - uses: actions/checkout@v3 |
| 57 | + - uses: actions/setup-go@v3 |
| 58 | + with: |
| 59 | + go-version-file: go.mod |
| 60 | + - uses: actions/cache@v2 |
| 61 | + continue-on-error: true |
| 62 | + timeout-minutes: 2 |
| 63 | + with: |
| 64 | + path: ~/go/pkg/mod |
| 65 | + key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} |
| 66 | + - name: goreleaser build |
| 67 | + uses: goreleaser/goreleaser-action@v2 |
| 68 | + with: |
| 69 | + args: build --config .github/goreleaser-cross-compiler-test.yml --id 32-bit-arch --snapshot |
0 commit comments