1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-08 03:31:59 +02:00
goreleaser/.github/workflows/build.yml
dependabot[bot] 82f5785fd7
chore(deps): bump actions/setup-go from 3.0.0 to 3.1.0 (#3108)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](f6164bd8c8...fcdc43634a)

---
updated-dependencies:
- dependency-name: actions/setup-go
  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>
2022-05-13 09:47:56 -03:00

123 lines
4.6 KiB
YAML

name: build
on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
permissions:
contents: write
id-token: write
packages: write
jobs:
goreleaser-check-pkgs:
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
needs:
- goreleaser
if: github.ref == 'refs/heads/main'
strategy:
matrix:
format: [ deb, rpm, apk ]
steps:
- uses: actions/checkout@b0e28b5ac45a892f91e7d036f8200cf5ed489415 # v3
with:
fetch-depth: 0
- uses: arduino/setup-task@ca745e18916de727f841ec824ac20a615f1cddea # v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-qemu-action@8b122486cedac8393e77aa9734c3528886e4a1a8 # v1
- uses: actions/cache@661fd3eb7f2f20d8c7c84bc2b0509efd7a826628 # v2
with:
path: |
./dist/*.deb
./dist/*.rpm
./dist/*.apk
key: ${{ runner.os }}-go-${{ hashFiles('**/*.go') }}-${{ hashFiles('**/go.sum') }}
- run: task goreleaser:test:${{ matrix.format }}
goreleaser:
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
- uses: actions/checkout@b0e28b5ac45a892f91e7d036f8200cf5ed489415 # v3
with:
fetch-depth: 0
- uses: arduino/setup-task@ca745e18916de727f841ec824ac20a615f1cddea # v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-qemu-action@8b122486cedac8393e77aa9734c3528886e4a1a8 # v1
- uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6 # v1
- name: setup-snapcraft
# FIXME: the mkdirs are a hack for https://github.com/goreleaser/goreleaser/issues/1715
run: |
sudo apt-get update
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
mkdir -p $HOME/.cache/snapcraft/download
mkdir -p $HOME/.cache/snapcraft/stage-packages
- uses: actions/setup-go@fcdc43634adb5f7ae75a9d7a9b9361790f7293e2 # v2
with:
go-version: '1.18'
- uses: actions/cache@661fd3eb7f2f20d8c7c84bc2b0509efd7a826628 # v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/cache@661fd3eb7f2f20d8c7c84bc2b0509efd7a826628 # v2
with:
path: |
./dist/*.deb
./dist/*.rpm
./dist/*.apk
key: ${{ runner.os }}-go-${{ hashFiles('**/*.go') }}-${{ hashFiles('**/go.sum') }}
- uses: sigstore/cosign-installer@ab3bb6a537fb08a1b78f7d1175fff799ca6850a3 # v2.1.0
- uses: anchore/sbom-action/download-syft@bb716408e75840bbb01e839347cd213767269d4a # v0.10.0
- name: setup-validate-krew-manifest
run: go install sigs.k8s.io/krew/cmd/validate-krew-manifest@latest
- run: task ci
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3
with:
file: ./coverage.txt
- run: ./goreleaser check
- run: git diff
- name: dockerhub-login
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: ghcr-login
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: snapcraft-login
if: startsWith(github.ref, 'refs/tags/v')
run: snapcraft login --with <(echo "${{ secrets.SNAPCRAFT_LOGIN }}")
- name: goreleaser-release
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
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 }}
COSIGN_PWD: ${{ secrets.COSIGN_PWD }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
DISCORD_WEBHOOK_ID: ${{ secrets.DISCORD_WEBHOOK_ID }}
DISCORD_WEBHOOK_TOKEN: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
AUR_KEY: ${{ secrets.AUR_KEY }}
run: task goreleaser