Skip to content

Commit 442af1e

Browse files
committed
feat(ci): Separate actions for versioning canary/main
1 parent 8267f20 commit 442af1e

File tree

2 files changed

+66
-1
lines changed

2 files changed

+66
-1
lines changed

.github/workflows/version-canary.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: rsnd
2+
3+
on:
4+
push:
5+
branches:
6+
- canary
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
release:
12+
name: version
13+
runs-on: buildjet-4vcpu-ubuntu-2204
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
steps:
18+
- name: Checkout Repo
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 22
27+
28+
- name: Enable Corepack
29+
id: pnpm-setup
30+
run: |
31+
corepack enable
32+
corepack prepare [email protected] --activate
33+
pnpm config set script-shell "/usr/bin/bash"
34+
35+
- name: pnpm Cache
36+
uses: buildjet/cache@v4
37+
with:
38+
path: |
39+
~/.pnpm-store
40+
node_modules
41+
*/*/node_modules
42+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
43+
restore-keys: |
44+
${{ runner.os }}-pnpm-
45+
46+
- name: Install packages
47+
if: steps.pnpm-cache.outputs.cache-hit != 'true'
48+
run: pnpm install --frozen-lockfile
49+
50+
- name: Enter prerelease mode
51+
# This step errors if it is already in prerelease mode
52+
continue-on-error: true
53+
run: pnpm canary:enter
54+
55+
- name: Create Release Pull Request
56+
uses: changesets/action@v1
57+
with:
58+
version: pnpm run version
59+
title: "chore(root): Version packages"
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/version.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
- canary
87

98
concurrency: ${{ github.workflow }}-${{ github.ref }}
109

@@ -48,6 +47,11 @@ jobs:
4847
if: steps.pnpm-cache.outputs.cache-hit != 'true'
4948
run: pnpm install --frozen-lockfile
5049

50+
- name: Exit prerelease mode
51+
# This step errors if it is not in prerelease mode
52+
continue-on-error: true
53+
run: pnpm canary:exit
54+
5155
- name: Create Release Pull Request
5256
uses: changesets/action@v1
5357
with:

0 commit comments

Comments
 (0)