Skip to content

Commit cf6cec8

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

File tree

9 files changed

+407
-457
lines changed

9 files changed

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