mirror of
https://github.com/goreleaser/nfpm
synced 2024-05-07 13:56:12 +02:00
b4a2d85284
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1 to 2. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/v1...v2) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
141 lines
4.2 KiB
YAML
141 lines
4.2 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- v*
|
|
branches:
|
|
- 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@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
- uses: arduino/setup-task@v1
|
|
with:
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: actions/cache@v3
|
|
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@v3
|
|
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 ]
|
|
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@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
- uses: arduino/setup-task@v1
|
|
with:
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: actions/cache@v3
|
|
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@v2
|
|
- uses: docker/setup-buildx-action@v2
|
|
- 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
|
|
permissions:
|
|
contents: write
|
|
id-token: write
|
|
packages: write
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
- uses: arduino/setup-task@v1
|
|
with:
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/go/pkg/mod
|
|
~/.cache/go-build
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
- uses: sigstore/cosign-installer@v2.3.0
|
|
- uses: anchore/sbom-action/download-syft@v0.11.0
|
|
- uses: docker/setup-qemu-action@v2
|
|
- uses: docker/setup-buildx-action@v2
|
|
- run: task setup
|
|
- run: task build
|
|
- uses: docker/login-action@v2
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
- uses: docker/login-action@v2
|
|
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 }}
|
|
AUR_KEY: ${{ secrets.AUR_KEY }}
|