Skip to content

Commit 904d883

Browse files
authored
ci: automated release, gated on CI passing on main (#2)
1 parent 79be0ed commit 904d883

2 files changed

Lines changed: 12 additions & 14 deletions

File tree

.changeset/initial-release.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
name: Release
22

3+
# Runs automatically only AFTER the CI workflow succeeds on main, so a red
4+
# main never publishes. The changesets flow then takes over:
5+
# 1. add a changeset in your PR, merge to main
6+
# 2. CI passes -> this opens/updates a "Version Packages" PR
7+
# 3. merging THAT PR re-runs CI -> this publishes to npm
38
on:
4-
push:
9+
workflow_run:
10+
workflows: [CI]
511
branches: [main]
12+
types: [completed]
613

714
concurrency: ${{ github.workflow }}-${{ github.ref }}
815

@@ -13,9 +20,13 @@ permissions:
1320

1421
jobs:
1522
release:
23+
# Only release when CI on a push to main actually passed.
24+
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' }}
1625
runs-on: ubuntu-latest
1726
steps:
1827
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
1930

2031
# Installs Node and pnpm at the exact versions pinned in mise.toml.
2132
- name: Setup toolchain (mise)

0 commit comments

Comments
 (0)