1
1
Fork 0
mirror of https://github.com/goreleaser/nfpm synced 2024-05-27 00:36:10 +02:00
nfpm/.github/workflows/build.yml

140 lines
4.2 KiB
YAML
Raw Normal View History

name: build
on:
push:
tags:
- v*
branches:
2021-11-12 21:18:34 +01:00
- main
pull_request:
jobs:
unit-tests:
strategy:
matrix:
go-version: [ 1.17 ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: task setup
- run: task test
- run: git diff
- uses: codecov/codecov-action@v2
if: matrix.os == 'ubuntu-latest'
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
Acceptance-Tests:
strategy:
matrix:
go-version: [ 1.17 ]
pkgFormat: [ deb, rpm, apk ]
2021-11-14 01:19:11 +01:00
pkgPlatform: [ amd64, arm64, 386, ppc64le, armv6, armv7, s390x ]
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
NO_TEST_PPC64LE: "true"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- run: task setup
- run: TEST_PATTERN=/${{ matrix.pkgFormat }}/${{ matrix.pkgPlatform }}/ task acceptance
goreleaser:
strategy:
matrix:
go-version: [ 1.17 ]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs:
- unit-tests
- Acceptance-Tests
chore(ci): keyless signing (#413) * chore(ci): keyless signing Signed-off-by: Carlos A Becker <caarlos0@gmail.com> * docs: fix Signed-off-by: Carlos A Becker <caarlos0@gmail.com> * fix: ci Signed-off-by: Carlos A Becker <caarlos0@gmail.com> * fix: vercel build script Signed-off-by: Carlos A Becker <caarlos0@gmail.com> * docs: improve wording Signed-off-by: Carlos A Becker <caarlos0@gmail.com> * docs: improve wording Signed-off-by: Carlos A Becker <caarlos0@gmail.com> * docs: improve wording Signed-off-by: Carlos A Becker <caarlos0@gmail.com> * chore(Taskfile): Remove -s flag for gofumpt (#421) * chore(deps): bump sigstore/cosign-installer from 1.3.1 to 1.4.1 (#425) Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 1.3.1 to 1.4.1. - [Release notes](https://github.com/sigstore/cosign-installer/releases) - [Commits](https://github.com/sigstore/cosign-installer/compare/v1.3.1...v1.4.1) --- updated-dependencies: - dependency-name: sigstore/cosign-installer dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * feat(deps): bump github.com/spf13/cobra from 1.2.1 to 1.3.0 (#426) Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.2.1 to 1.3.0. - [Release notes](https://github.com/spf13/cobra/releases) - [Changelog](https://github.com/spf13/cobra/blob/master/CHANGELOG.md) - [Commits](https://github.com/spf13/cobra/compare/v1.2.1...v1.3.0) --- updated-dependencies: - dependency-name: github.com/spf13/cobra dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: fix links Signed-off-by: Carlos A Becker <caarlos0@gmail.com> * docs: update help after cobra upgrade Signed-off-by: Carlos A Becker <caarlos0@gmail.com> * fix: name Signed-off-by: Carlos A Becker <caarlos0@gmail.com> Co-authored-by: 4censord <49623362+4censord@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-15 19:30:49 +01:00
permissions:
contents: write
id-token: write
packages: write
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: sigstore/cosign-installer@v1.4.1
- uses: anchore/sbom-action/download-syft@v0.6.0
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- run: task setup
- run: task build
- uses: docker/login-action@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/login-action@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: goreleaser/goreleaser-action@v2
if: success()
with:
version: latest
args: release --rm-dist
distribution: goreleaser-pro
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
DISCORD_WEBHOOK_ID: ${{ secrets.DISCORD_WEBHOOK_ID }}
DISCORD_WEBHOOK_TOKEN: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}