1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-23 21:19:17 +02:00

Merge remote-tracking branch 'origin/main'

This commit is contained in:
Carlos A Becker 2021-11-14 12:27:28 -03:00
commit 048557efdb
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -9,97 +9,99 @@ on:
pull_request: pull_request:
jobs: 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@v2
with:
fetch-depth: 0
- uses: arduino/setup-task@v1
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-qemu-action@v1
- uses: actions/cache@v2
with:
path: ./dist
key: ${{ runner.os }}-go-${{ hashFiles('**/*.go') }}-${{ hashFiles('**/go.sum') }}
- run: task goreleaser:test:${{ matrix.format }}
goreleaser: goreleaser:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
DOCKER_CLI_EXPERIMENTAL: "enabled" DOCKER_CLI_EXPERIMENTAL: "enabled"
steps: steps:
- - uses: actions/checkout@v2
name: Checkout
uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- - uses: arduino/setup-task@v1
name: Set up Task
uses: arduino/setup-task@v1
with: with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
- - uses: docker/setup-qemu-action@v1
name: Set up QEMU - uses: docker/setup-buildx-action@v1
uses: docker/setup-qemu-action@v1 - name: setup-buildpacks
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Set up Pack CLI for Buildpacks
run: | run: |
sudo add-apt-repository ppa:cncf-buildpacks/pack-cli sudo add-apt-repository ppa:cncf-buildpacks/pack-cli
sudo apt-get update sudo apt-get update
sudo apt-get --no-install-suggests --no-install-recommends install pack-cli sudo apt-get --no-install-suggests --no-install-recommends install pack-cli
- - name: setup-snapcraft
name: Set up Snapcraft
# FIXME: the mkdirs are a hack for https://github.com/goreleaser/goreleaser/issues/1715 # FIXME: the mkdirs are a hack for https://github.com/goreleaser/goreleaser/issues/1715
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
mkdir -p $HOME/.cache/snapcraft/download mkdir -p $HOME/.cache/snapcraft/download
mkdir -p $HOME/.cache/snapcraft/stage-packages mkdir -p $HOME/.cache/snapcraft/stage-packages
- - uses: actions/setup-go@v2
name: Set up Go
uses: actions/setup-go@v2
with: with:
go-version: '1.17' go-version: '1.17'
- - uses: actions/cache@v2
name: Cache Go mod and build
uses: actions/cache@v2
with: with:
path: | path: |
~/go/pkg/mod ~/go/pkg/mod
~/.cache/go-build ~/.cache/go-build
./dist
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: | restore-keys: |
${{ runner.os }}-go- ${{ runner.os }}-go-
- - uses: actions/cache@v2
name: Setup Sigstore with:
uses: sigstore/cosign-installer@v1.3.1 path: ./dist
- # TODO: replace this once https://github.com/kubernetes-sigs/krew/pull/736 is merged key: ${{ runner.os }}-go-${{ hashFiles('**/*.go') }}-${{ hashFiles('**/go.sum') }}
name: Install validate-krew-manifest - uses: sigstore/cosign-installer@v1.3.1
- name: setup-validate-krew-manifest
# TODO: replace this once https://github.com/kubernetes-sigs/krew/pull/736 is merged
run: go install github.com/caarlos0/krew/cmd/validate-krew-manifest@fork run: go install github.com/caarlos0/krew/cmd/validate-krew-manifest@fork
- - run: task ci
name: build and test - uses: codecov/codecov-action@v2
run: task ci
-
name: Upload coverage
uses: codecov/codecov-action@v2
with: with:
file: ./coverage.txt file: ./coverage.txt
- - run: ./goreleaser check
name: Check - run: git diff
run: ./goreleaser check - name: dockerhub-login
-
name: Diff
run: git diff
-
name: Login to Docker Hub
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- - name: ghcr-login
name: Login to GitHub Container Registry
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.repository_owner }} username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- - name: snapcraft-login
name: Snapcraft Login
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
run: snapcraft login --with <(echo "${{ secrets.SNAPCRAFT_LOGIN }}") run: snapcraft login --with <(echo "${{ secrets.SNAPCRAFT_LOGIN }}")
- - name: goreleaser-release
name: GoReleaser
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'
env: env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }} GITHUB_TOKEN: ${{ secrets.GH_PAT }}