on master help sign in
chore(ci): support "preview" release CI runs
0090a2dyvt
.github/workflows/release.yml+20
@@ -4,6 +4,18 @@ on:
4 tags:
4 tags:
5 - '[0-9]+.[0-9]+'
5 - '[0-9]+.[0-9]+'
6 - '[0-9]+.[0-9]+.[0-9]+'
6 - '[0-9]+.[0-9]+.[0-9]+'
7+ branches:
8+ - 'patch/ci-release-*'
9+ pull_request:
10+ paths:
11+ - '.github/workflows/release.yml'
12+
13+env:
14+ # Preview mode: Publishes the build output as a CI artifact instead of creating
15+ # a release, allowing for manual inspection of the output. This mode is
16+ # activated if the CI run was triggered by events other than pushed tags, or
17+ # if the repository is a fork.
18+ preview: ${{ !startsWith(github.ref, 'refs/tags/') || github.repository != 'helix-editor/helix' }}
7
19
8jobs:
20jobs:
9 fetch-grammars:
21 fetch-grammars:
@@ -268,9 +280,17 @@ jobs:
268
280
269 - name: Upload binaries to release
281 - name: Upload binaries to release
270 uses: svenstaro/upload-release-action@v2
282 uses: svenstaro/upload-release-action@v2
283+ if: env.preview == 'false'
271 with:
284 with:
272 repo_token: ${{ secrets.GITHUB_TOKEN }}
285 repo_token: ${{ secrets.GITHUB_TOKEN }}
273 file: dist/*
286 file: dist/*
274 file_glob: true
287 file_glob: true
275 tag: ${{ steps.tagname.outputs.val }}
288 tag: ${{ steps.tagname.outputs.val }}
276 overwrite: true
289 overwrite: true
290+
291+ - name: Upload binaries as artifact
292+ uses: actions/upload-artifact@v2
293+ if: env.preview == 'true'
294+ with:
295+ name: release
296+ path: dist/*