diff options
author | yvt | 2022-06-20 03:31:14 +0000 |
---|---|---|
committer | Michael Davis | 2022-09-10 13:36:48 +0000 |
commit | 0090a2d86fd573127d28ce99546e200579390d9b (patch) | |
tree | 93fe68f6e1bf1c96c7e511b196023689048b9c84 /.github/workflows | |
parent | 29fe0c3862a6bf549101c621f72502cc1e7b2631 (diff) |
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.
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/release.yml | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 66be880e..c9510ec0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,18 @@ on: tags: - '[0-9]+.[0-9]+' - '[0-9]+.[0-9]+.[0-9]+' + branches: + - 'patch/ci-release-*' + pull_request: + paths: + - '.github/workflows/release.yml' + +env: + # Preview mode: Publishes the build output as a CI artifact instead of creating + # a release, allowing for manual inspection of the output. This mode is + # activated if the CI run was triggered by events other than pushed tags, or + # if the repository is a fork. + preview: ${{ !startsWith(github.ref, 'refs/tags/') || github.repository != 'helix-editor/helix' }} jobs: fetch-grammars: @@ -268,9 +280,17 @@ jobs: - name: Upload binaries to release uses: svenstaro/upload-release-action@v2 + if: env.preview == 'false' with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: dist/* file_glob: true tag: ${{ steps.tagname.outputs.val }} overwrite: true + + - name: Upload binaries as artifact + uses: actions/upload-artifact@v2 + if: env.preview == 'true' + with: + name: release + path: dist/* |