Skip to content

Commit

Permalink
ci: improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <[email protected]>
  • Loading branch information
caarlos0 committed Aug 11, 2021
1 parent 3e4935f commit 56e6941
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 40 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,52 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
-
name: Cache Go modules
- name: Cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Make Setup
- name: Make Setup
run: |
make setup
-
name: Make CI
- name: Make CI
run: |
make ci
-
name: Upload coverage
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
-
name: Set up Snapcraft
- name: Set up Snapcraft
if: success() && startsWith(github.ref, 'refs/tags/')
env:
SNAPCRAFT_LOGIN: ${{ secrets.SNAPCRAFT_LOGIN }}
run: |
sudo apt-get update
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
snapcraft login --with <(echo "$SNAPCRAFT_LOGIN")
-
name: Run GoReleaser
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: success() && startsWith(github.ref, 'refs/tags/')
with:
distribution: goreleaser-pro
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
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 }}
43 changes: 19 additions & 24 deletions goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
gomod:
proxy: true
builds:
- main: ./cmd/fork-cleaner
goarch:
- amd64
- arm64
brews:
- tap:
owner: caarlos0
name: homebrew-tap
variables:
homepage: https://github.com/caarlos0/fork-cleaner
description: Cleans up old and inactive forks on your github account.
folder: Formula

includes:
- from_url:
url: https://raw.githubusercontent.com/caarlos0/goreleaserfiles/main/build.yml
- from_url:
url: https://raw.githubusercontent.com/caarlos0/goreleaserfiles/main/release.yml
- from_url:
url: https://raw.githubusercontent.com/caarlos0/goreleaserfiles/main/package.yml

before:
hooks:
- go mod tidy

furies:
- account: caarlos0

snapcrafts:
- publish: true
summary: Cleans up old and inactive forks on your github account.
description: |
Cleans up old and inactive forks on your GitHub account.
summary: '{{ .description }}'
description: '{{ .description }}'
grade: stable
apps:
fork-cleaner:
plugs: ["network"]
command: fork-cleaner
nfpms:
- maintainer: Carlos A Becker <[email protected]>
description: Cleans up old and inactive forks on your GitHub account.
license: MIT
formats:
- deb
- rpm
- apk

0 comments on commit 56e6941

Please sign in to comment.