mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-10 03:47:03 +02:00
8c19bafdca
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 1 to 2.0.1. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v1...v2.0.1) --- updated-dependencies: - dependency-name: codecov/codecov-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>
104 lines
2.8 KiB
YAML
104 lines
2.8 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
tags:
|
|
- 'v*'
|
|
pull_request:
|
|
|
|
jobs:
|
|
goreleaser:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
-
|
|
name: Set up 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
|
|
-
|
|
name: Set up Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: '1.16'
|
|
-
|
|
name: Cache Go modules
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
-
|
|
name: Make Setup
|
|
run: |
|
|
make setup
|
|
-
|
|
name: Make CI
|
|
run: |
|
|
make ci
|
|
-
|
|
name: Upload coverage
|
|
uses: codecov/codecov-action@v2.0.1
|
|
with:
|
|
file: ./coverage.txt
|
|
-
|
|
name: Check
|
|
run: |
|
|
./goreleaser check
|
|
-
|
|
name: Diff
|
|
run: git diff
|
|
-
|
|
name: Login to Docker Hub
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
-
|
|
name: Login to GitHub Container Registry
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
uses: docker/login-action@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
|
|
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 }}
|
|
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
|
|
run: |
|
|
if [[ $GITHUB_REF == refs/tags/v* ]]; then
|
|
./goreleaser
|
|
elif [[ $GITHUB_REF == refs/heads/master ]]; then
|
|
./goreleaser --snapshot
|
|
fi
|