goreleaser-action/.github/workflows/ci.yml

199 lines
4.5 KiB
YAML
Raw Normal View History

2019-09-22 05:17:07 +00:00
name: ci
2019-09-20 20:23:45 +00:00
on:
2020-05-23 23:15:17 +00:00
schedule:
- cron: '0 10 * * *' # everyday at 10am
2019-09-20 20:23:45 +00:00
push:
branches:
2020-12-01 19:40:45 +00:00
- 'master'
- 'releases/v*'
2020-12-01 19:41:26 +00:00
tags:
- 'v*'
2020-12-01 19:40:45 +00:00
pull_request:
branches:
- 'master'
- 'releases/v*'
2019-09-20 20:23:45 +00:00
jobs:
2019-09-22 05:17:07 +00:00
ci:
2019-09-20 20:23:45 +00:00
runs-on: ${{ matrix.os }}
strategy:
2019-09-22 05:17:07 +00:00
fail-fast: false
2019-09-20 20:23:45 +00:00
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
version:
- latest
- '~> 0.182'
distribution:
- goreleaser
- goreleaser-pro
2019-09-20 20:23:45 +00:00
steps:
-
name: Checkout
uses: actions/checkout@v3
2020-06-15 16:36:44 +00:00
with:
fetch-depth: 0
2019-09-20 20:23:45 +00:00
-
name: Set up Go
uses: actions/setup-go@v3
2019-12-24 10:37:15 +00:00
with:
go-version: 1.18
-
name: Check
uses: ./
with:
version: ${{ matrix.version }}
args: check --debug
workdir: ./test
2019-09-20 20:23:45 +00:00
-
name: GoReleaser
if: ${{ !(github.event_name == 'pull_request' && matrix.distribution == 'goreleaser-pro') }}
2019-09-20 20:23:45 +00:00
uses: ./
env:
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
2019-09-20 20:23:45 +00:00
with:
distribution: ${{ matrix.distribution }}
2019-09-20 20:23:45 +00:00
version: ${{ matrix.version }}
2019-09-20 21:14:11 +00:00
args: release --skip-publish --rm-dist
workdir: ./test
install-only:
2020-11-06 20:30:01 +00:00
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- latest
- '~> 0.166'
distribution:
- goreleaser
- goreleaser-pro
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
-
name: GoReleaser
if: ${{ !(github.event_name == 'pull_request' && matrix.distribution == 'goreleaser-pro') }}
uses: ./
with:
distribution: ${{ matrix.distribution }}
version: ${{ matrix.version }}
install-only: true
-
name: Check
if: ${{ !(github.event_name == 'pull_request' && matrix.distribution == 'goreleaser-pro') }}
run: |
goreleaser check --debug
signing:
runs-on: ${{ matrix.os }}
2020-11-06 19:48:03 +00:00
if: github.event_name != 'pull_request'
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
2020-06-15 16:36:44 +00:00
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
-
name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY_TEST }}
passphrase: ${{ secrets.PASSPHRASE_TEST }}
-
name: Check
uses: ./
with:
version: latest
args: -f .goreleaser-signing.yml check --debug
workdir: ./test
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
-
name: GoReleaser
uses: ./
with:
version: latest
args: -f .goreleaser-signing.yml release --skip-publish --rm-dist
workdir: ./test
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
upload-artifact:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
-
name: Check
uses: ./
with:
args: check --debug
workdir: ./test
-
name: GoReleaser
uses: ./
with:
args: release --skip-publish --rm-dist
workdir: ./test
-
name: Upload assets
uses: actions/upload-artifact@v3
with:
name: myapp
path: ./test/dist/*
current-tag:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
-
name: GoReleaser
uses: ./
with:
args: release --skip-publish --rm-dist
workdir: ./test
env:
GORELEASER_CURRENT_TAG: v99.99.99