Skip to content

Commit c87ee48

Browse files
committed
ci(release): single oxlint and oxfmt release pipeline
1 parent b1d3e00 commit c87ee48

File tree

9 files changed

+404
-457
lines changed

9 files changed

+404
-457
lines changed
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Prepare Release Apps
2+
3+
permissions: {}
4+
5+
on:
6+
workflow_dispatch:
7+
push:
8+
branches:
9+
- release-apps
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
prepare:
17+
name: Prepare Release
18+
runs-on: ubuntu-latest
19+
outputs:
20+
pull-request-number: ${{ steps.pr.outputs.pull-request-number }}
21+
oxlint_version: ${{ steps.run.outputs.OXLINT_VERSION }}
22+
oxfmt_version: ${{ steps.run.outputs.OXFMT_VERSION }}
23+
steps:
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
25+
with:
26+
fetch-depth: 0
27+
persist-credentials: false
28+
29+
- uses: oxc-project/setup-rust@f03aedf4620c1d3aa169a2510e24787d362bbe0b # v1.0.8
30+
with:
31+
cache-key: warm
32+
tools: cargo-release-oxc
33+
34+
- run: cargo ck
35+
36+
- name: Generate version and changelog
37+
id: run
38+
run: |
39+
cargo release-oxc update --release oxlint --release oxfmt
40+
echo "OXLINT_VERSION=$(cat ./target/OXLINT_VERSION)" >> $GITHUB_OUTPUT
41+
echo "OXFMT_VERSION=$(cat ./target/OXFMT_VERSION)" >> $GITHUB_OUTPUT
42+
{
43+
echo 'CHANGELOG<<EOF'
44+
echo '# Oxlint'
45+
echo
46+
cat ./target/OXLINT_CHANGELOG
47+
echo '# Oxfmt'
48+
echo
49+
cat ./target/OXFMT_CHANGELOG
50+
echo EOF
51+
} >> $GITHUB_OUTPUT
52+
53+
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
54+
55+
- name: Rebuild NAPI bindings
56+
run: |
57+
pnpm --filter oxlint run build-dev
58+
pnpm --filter oxfmt run build-dev
59+
60+
- name: Update Cargo.lock
61+
run: cargo check
62+
63+
- uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
64+
id: pr
65+
with:
66+
# bot account with PAT required for triggering workflow runs
67+
# See https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
68+
token: ${{ secrets.OXC_BOT_PAT }}
69+
commit-message: "release(apps): oxlint v${{ steps.run.outputs.OXLINT_VERSION }} && oxfmt v${{ steps.run.outputs.OXFMT_VERSION }}"
70+
title: "release(apps): oxlint v${{ steps.run.outputs.OXLINT_VERSION }} && oxfmt v${{ steps.run.outputs.OXFMT_VERSION }}"
71+
branch: release/apps
72+
branch-suffix: timestamp
73+
base: main
74+
body: ${{ steps.run.outputs.CHANGELOG }}
75+
assignees: Boshen
76+
77+
ecosystem-ci:
78+
needs: prepare
79+
name: Trigger Ecosystem CI
80+
runs-on: ubuntu-latest
81+
permissions:
82+
pull-requests: write
83+
contents: write
84+
steps:
85+
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
86+
87+
- uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
88+
id: comment
89+
with:
90+
token: ${{ secrets.GITHUB_TOKEN }}
91+
issue-number: ${{ needs.prepare.outputs.pull-request-number }}
92+
body: Triggering Ecosystem CI https://github.com/oxc-project/oxlint-ecosystem-ci/actions/workflows/ci.yml
93+
94+
- uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4
95+
with:
96+
repo: oxc-project/oxlint-ecosystem-ci
97+
workflow: ci.yml
98+
token: ${{ secrets.OXC_BOT_PAT }}
99+
ref: main
100+
inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "comment-id": "${{ steps.comment.outputs.comment-id }}" }'
101+
102+
website:
103+
needs: prepare
104+
name: Update oxc.rs
105+
runs-on: ubuntu-latest
106+
permissions:
107+
actions: write
108+
steps:
109+
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
110+
- uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4
111+
with:
112+
repo: oxc-project/oxc-project.github.io
113+
workflow: release.yml
114+
token: ${{ secrets.OXC_BOT_PAT }}
115+
ref: main
116+
inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "version": "${{ needs.prepare.outputs.oxlint_version }}" }'

.github/workflows/prepare_release_crates.yml

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,61 @@ jobs:
2323
- run: cargo release-oxc publish --release crates --dry-run
2424

2525
prepare:
26-
needs: check
27-
name: Prepare Release Crates
28-
uses: ./.github/workflows/reusable_prepare_release.yml
29-
with:
30-
name: crates
31-
secrets:
32-
OXC_BOT_PAT: ${{ secrets.OXC_BOT_PAT }}
26+
name: Prepare Release
27+
runs-on: ubuntu-latest
28+
outputs:
29+
pull-request-number: ${{ steps.pr.outputs.pull-request-number }}
30+
version: ${{ steps.run.outputs.CRATES_VERSION }}
31+
steps:
32+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
33+
with:
34+
fetch-depth: 0
35+
persist-credentials: false
36+
37+
- uses: oxc-project/setup-rust@f03aedf4620c1d3aa169a2510e24787d362bbe0b # v1.0.8
38+
with:
39+
cache-key: warm
40+
tools: cargo-release-oxc
41+
42+
- name: Run
43+
id: run
44+
run: |
45+
cargo ck
46+
cargo release-oxc update --release crates
47+
echo "CRATES_VERSION=$(cat ./target/CRATES_VERSION)" >> $GITHUB_OUTPUT
48+
{
49+
echo 'CHANGELOG<<EOF'
50+
cat ./target/CRATES_CHANGELOG
51+
echo EOF
52+
} >> $GITHUB_OUTPUT
53+
54+
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
55+
56+
# Run NAPI-RS build, because NAPI-RS uses version from `package.json` in the bindings file,
57+
# which is committed to the repo. The version has just been bumped in previous step.
58+
# We don't use the compiled `.node` binary, so only do a development build, as it's faster.
59+
- name: Rebuild NAPI packages bindings
60+
run: |
61+
pnpm --filter oxc-minify run build-dev
62+
pnpm --filter oxc-parser run build-dev
63+
pnpm --filter oxc-transform run build-dev
64+
65+
- name: Update Cargo.lock
66+
run: cargo check
67+
68+
- uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
69+
id: pr
70+
with:
71+
# bot account with PAT required for triggering workflow runs
72+
# See https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
73+
token: ${{ secrets.OXC_BOT_PAT }}
74+
commit-message: "release(crates): oxc v${{ steps.run.outputs.OXC_VERSION }}"
75+
title: "release(crates): oxc v${{ steps.run.outputs.CRATES_VERSION }}"
76+
branch: release/crates
77+
branch-suffix: timestamp
78+
base: main
79+
body: ${{ steps.run.outputs.CHANGELOG }}
80+
assignees: Boshen
3381

3482
ecosystem-ci:
3583
needs: prepare

.github/workflows/prepare_release_oxfmt.yml

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

.github/workflows/prepare_release_oxlint.yml

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

0 commit comments

Comments
 (0)