Skip to content

Commit 2b8d9cb

Browse files
committed
chore: add dry-run functionality to release workflow
1 parent 9ddb587 commit 2b8d9cb

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

.github/workflows/release.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
tags:
55
- "v*"
66
workflow_dispatch:
7+
inputs:
8+
snapshot:
9+
description: Perform a snapshot/dry-run release (required if the ref is not a tag)
10+
type: boolean
11+
required: true
712

813
jobs:
914
linux-windows:
@@ -53,7 +58,7 @@ jobs:
5358
uses: goreleaser/goreleaser-action@v3
5459
with:
5560
version: latest
56-
args: release -f ./.goreleaser-linux.yaml --rm-dist --timeout 60m --snapshot
61+
args: release -f ./.goreleaser-release-linux.yaml --rm-dist --timeout 60m --skip-publish --skip-announce ${{ github.event.inputs.snapshot && '--snapshot' }}
5762

5863
- name: Upload binary artifacts
5964
uses: actions/upload-artifact@v3
@@ -125,7 +130,7 @@ jobs:
125130
uses: goreleaser/goreleaser-action@v3
126131
with:
127132
version: latest
128-
args: release -f ./.goreleaser-darwin.yaml --rm-dist --timeout 60m --snapshot
133+
args: release -f ./.goreleaser-release-darwin.yaml --rm-dist --timeout 60m --skip-publish --skip-announce ${{ github.event.inputs.snapshot && '--snapshot' }}
129134
env:
130135
AC_USERNAME: ${{ secrets.AC_USERNAME }}
131136
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
@@ -181,9 +186,15 @@ jobs:
181186
# we use the "prebuilt" builder here which is a pro-only feature
182187
distribution: goreleaser-pro
183188
version: latest
184-
args: release -f ./.goreleaser-release.yaml --rm-dist --timeout 60m --snapshot
189+
args: release -f ./.goreleaser-release.yaml --rm-dist --timeout 60m ${{ github.event.inputs.snapshot && '--snapshot' }}
185190
env:
186191
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
187192
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
188193
AC_USERNAME: ${{ secrets.AC_USERNAME }}
189194
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
195+
196+
- name: Upload artifacts
197+
uses: actions/upload-artifact@v3
198+
with:
199+
name: release
200+
path: ./dist/*

0 commit comments

Comments
 (0)