feat: add artifacts and metadata outputs (#327) #1740
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
schedule: | |
- cron: '0 10 * * *' # everyday at 10am | |
push: | |
branches: | |
- 'master' | |
- 'releases/v*' | |
tags: | |
- 'v*' | |
pull_request: | |
branches: | |
- 'master' | |
- 'releases/v*' | |
jobs: | |
ci: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macOS-latest | |
- windows-latest | |
version: | |
- latest | |
- '~> 0.182' | |
distribution: | |
- goreleaser | |
- goreleaser-pro | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- | |
name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.16 | |
- | |
name: Check | |
uses: ./ | |
with: | |
version: ${{ matrix.version }} | |
args: check --debug | |
workdir: ./test | |
- | |
name: GoReleaser | |
if: ${{ !(github.event_name == 'pull_request' && matrix.distribution == 'goreleaser-pro') }} | |
uses: ./ | |
env: | |
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} | |
with: | |
distribution: ${{ matrix.distribution }} | |
version: ${{ matrix.version }} | |
args: release --skip-publish --rm-dist | |
workdir: ./test | |
install-only: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
- latest | |
- '~> 0.166' | |
distribution: | |
- goreleaser | |
- goreleaser-pro | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- | |
name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.16 | |
- | |
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 }} | |
if: github.event_name != 'pull_request' | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macOS-latest | |
- windows-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- | |
name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.16 | |
- | |
name: Import GPG key | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@v4 | |
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@v2 | |
with: | |
fetch-depth: 0 | |
- | |
name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.16 | |
- | |
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@v2 | |
with: | |
name: myapp | |
path: ./test/dist/* |