Skip to content

Commit 0090a2d

Browse files
yvtthe-mikedavis
authored andcommitted
chore(ci): support "preview" release CI runs
Expands the trigger sources of the release CI workflow (`release.yml`), allowing the developers to test changes to `.github/workflows/release.yml` easily. The new trigger sources start the workflow in a "preview" mode, in which it publishes build outputs as a CI artifact instead of creating a new release so that they can be manually inspected. The following events trigger the preview mode: - Pushing to any branch matching the glob pattern `patch/ci-release-*`. - Opening a pull request that modifies `.github/workflows/release.yml`. - Pushing versioning tags to a forked repository.
1 parent 29fe0c3 commit 0090a2d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/release.yml

+20
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ on:
44
tags:
55
- '[0-9]+.[0-9]+'
66
- '[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' }}
719

820
jobs:
921
fetch-grammars:
@@ -268,9 +280,17 @@ jobs:
268280
269281
- name: Upload binaries to release
270282
uses: svenstaro/upload-release-action@v2
283+
if: env.preview == 'false'
271284
with:
272285
repo_token: ${{ secrets.GITHUB_TOKEN }}
273286
file: dist/*
274287
file_glob: true
275288
tag: ${{ steps.tagname.outputs.val }}
276289
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/*

0 commit comments

Comments
 (0)