Skip to content

Commit b4c56e6

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

File tree

9 files changed

+400
-458
lines changed

9 files changed

+400
-458
lines changed
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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+
{
41+
echo "CHANGELOG<<__OXC_EOF__"
42+
echo "# Oxlint"
43+
cat ./target/OXLINT_CHANGELOG
44+
echo ""
45+
echo "# Oxfmt"
46+
cat ./target/OXFMT_CHANGELOG
47+
echo "__OXC_EOF__"
48+
} >> $GITHUB_OUTPUT
49+
50+
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
51+
52+
- name: Rebuild NAPI bindings
53+
run: |
54+
pnpm --filter oxlint run build-dev
55+
pnpm --filter oxfmt run build-dev
56+
57+
- name: Update Cargo.lock
58+
run: cargo check
59+
60+
- uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
61+
id: pr
62+
with:
63+
# bot account with PAT required for triggering workflow runs
64+
# See https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
65+
token: ${{ secrets.OXC_BOT_PAT }}
66+
commit-message: "release(apps): oxlint v${{ steps.run.outputs.OXLINT_VERSION }} && oxfmt v${{ steps.run.outputs.OXFMT_VERSION }}"
67+
title: "release(apps): oxlint v${{ steps.run.outputs.OXLINT_VERSION }} && oxfmt v${{ steps.run.outputs.OXFMT_VERSION }}"
68+
branch: release/apps
69+
branch-suffix: timestamp
70+
base: main
71+
body: ${{ steps.run.outputs.CHANGELOG }}
72+
assignees: Boshen
73+
74+
ecosystem-ci:
75+
needs: prepare
76+
name: Trigger Ecosystem CI
77+
runs-on: ubuntu-latest
78+
permissions:
79+
pull-requests: write
80+
contents: write
81+
steps:
82+
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
83+
84+
- uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
85+
id: comment
86+
with:
87+
token: ${{ secrets.GITHUB_TOKEN }}
88+
issue-number: ${{ needs.prepare.outputs.pull-request-number }}
89+
body: Triggering Ecosystem CI https://github.com/oxc-project/oxlint-ecosystem-ci/actions/workflows/ci.yml
90+
91+
- uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4
92+
with:
93+
repo: oxc-project/oxlint-ecosystem-ci
94+
workflow: ci.yml
95+
token: ${{ secrets.OXC_BOT_PAT }}
96+
ref: main
97+
inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "comment-id": "${{ steps.comment.outputs.comment-id }}" }'
98+
99+
website:
100+
needs: prepare
101+
name: Update oxc.rs
102+
runs-on: ubuntu-latest
103+
permissions:
104+
actions: write
105+
steps:
106+
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
107+
- uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4
108+
with:
109+
repo: oxc-project/oxc-project.github.io
110+
workflow: release.yml
111+
token: ${{ secrets.OXC_BOT_PAT }}
112+
ref: main
113+
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)