Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: CI

on:
push:
Expand Down Expand Up @@ -26,15 +26,15 @@ jobs:
shell: pwsh

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- uses: actions/setup-node@v4
- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm

- name: Cache cargo
uses: actions/cache@v4
uses: actions/cache@v6
with:
path: |
~/.cargo/registry/index
Expand Down Expand Up @@ -68,15 +68,15 @@ jobs:
shell: pwsh

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- uses: actions/setup-node@v4
- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm

- name: Cache cargo
uses: actions/cache@v4
uses: actions/cache@v6
with:
path: |
~/.cargo/registry/index
Expand All @@ -100,7 +100,7 @@ jobs:

- run: npm run app:build

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: OpenEventViewer-installer
path: target/release/bundle/nsis/*-setup.exe
Expand Down
42 changes: 6 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
name: Release
name: Release

# Only ever by hand. A release is a decision, and nothing about merging a pull request says one
# has been taken.
on:
workflow_dispatch:
inputs:
dry_run:
description: Build and sign, publish nothing
type: boolean
default: false

permissions:
contents: write
Expand All @@ -19,10 +14,9 @@ jobs:
decide:
runs-on: ubuntu-latest
outputs:
publish: ${{ steps.check.outputs.publish }}
tag: ${{ steps.check.outputs.tag }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- name: Work out what would be released
id: check
Expand All @@ -33,20 +27,13 @@ jobs:
tag="v$version"
echo "tag=$tag" >> "$GITHUB_OUTPUT"

if [ "${{ inputs.dry_run }}" = "true" ]; then
echo "publish=false" >> "$GITHUB_OUTPUT"
echo "::notice::Rehearsal of $tag. Nothing will be published."
exit 0
fi

# Refused rather than overwritten: a tag that already names a release is the one thing
# somebody may already have downloaded.
if gh api "repos/${{ github.repository }}/git/ref/tags/$tag" >/dev/null 2>&1; then
echo "::error::$tag is already released. Run 'npm version patch', merge that, and trigger again."
exit 1
fi

echo "publish=true" >> "$GITHUB_OUTPUT"
echo "::notice::Releasing $tag. The pipeline creates the tag; nobody has to."

release:
Expand All @@ -57,15 +44,15 @@ jobs:
shell: pwsh

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- uses: actions/setup-node@v4
- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm

- name: Cache cargo
uses: actions/cache@v4
uses: actions/cache@v6
with:
path: |
~/.cargo/registry/index
Expand Down Expand Up @@ -159,28 +146,11 @@ jobs:
# `tag_name` on a tag that does not exist yet creates it at this commit, so nobody has to
# remember to tag by hand — bumping the version in tauri.conf.json is the whole ceremony.
- name: Publish the release
if: needs.decide.outputs.publish == 'true'
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ needs.decide.outputs.tag }}
files: |
target/release/bundle/nsis/*-setup.exe
target/release/bundle/nsis/*-setup.exe.sig
latest.json
fail_on_unmatched_files: true

- name: Keep what the rehearsal produced
if: needs.decide.outputs.publish != 'true'
uses: actions/upload-artifact@v4
with:
name: release-rehearsal
path: |
target/release/bundle/nsis/*-setup.exe
target/release/bundle/nsis/*-setup.exe.sig
latest.json
if-no-files-found: error

- name: Say that nothing was published
if: needs.decide.outputs.publish != 'true'
run: |
Write-Host '::notice::Rehearsal only. The installer, its signature and latest.json are attached to this run as an artifact. A release happens when a push to main carries a version that has no tag yet.'