1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2024-12-27 01:33:39 +02:00

chore(ci): improve release workflow

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos A Becker 2021-10-05 23:23:19 -03:00
parent d7e1bcc1f0
commit 2cf4d28157
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
3 changed files with 28 additions and 8 deletions

View File

@ -90,10 +90,10 @@ jobs:
-
name: Snapcraft Login
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
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
@ -104,9 +104,4 @@ jobs:
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
DISCORD_WEBHOOK_ID: ${{ secrets.DISCORD_WEBHOOK_ID }}
DISCORD_WEBHOOK_TOKEN: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
run: |
if [[ $GITHUB_REF == refs/tags/v* ]]; then
./goreleaser
elif [[ $GITHUB_REF == refs/heads/master ]]; then
./goreleaser --snapshot
fi
run: task goreleaser

1
.gitignore vendored
View File

@ -10,3 +10,4 @@ www/docs/static/releases*.json
.vercel
completions/
.vscode/
.task/

View File

@ -22,6 +22,10 @@ tasks:
build:
desc: Build the binary
sources:
- ./**/*.go
generates:
- ./goreleaser
cmds:
- go build
@ -72,3 +76,23 @@ tasks:
cmds:
- scripts/vercel/install.sh
- scripts/vercel/build.sh
release:
desc: Create a new tag
vars:
NEXT:
sh: svu n
cmds:
- git tag {{.NEXT}}
- echo {{.NEXT}}
- git push origin --tags
goreleaser:
desc: Run GoReleaser either in snapshot or release mode
deps:
- build
vars:
SNAPSHOT:
sh: 'if [[ $GITHUB_REF != refs/tags/v* ]]; then echo "--snapshot"; fi'
cmds:
- ./goreleaser release --rm-dist {{.SNAPSHOT}}