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:
parent
d7e1bcc1f0
commit
2cf4d28157
11
.github/workflows/build.yml
vendored
11
.github/workflows/build.yml
vendored
@ -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
1
.gitignore
vendored
@ -10,3 +10,4 @@ www/docs/static/releases*.json
|
||||
.vercel
|
||||
completions/
|
||||
.vscode/
|
||||
.task/
|
||||
|
24
Taskfile.yml
24
Taskfile.yml
@ -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}}
|
||||
|
Loading…
Reference in New Issue
Block a user