ci(release): single oxlint and oxfmt release pipeline (#15391)

part of #14722

* Release oxlint and oxfmt as a single github release (with different
versions)
* Adds biweekly schedule to release everything
This commit is contained in:
Boshen authored and GitHub committed 2025-11-08 15:16:57 +08:00
1 parent 8951953008
commit fbd334b4bd
10 files changed
+644 -712

No files matched your search

+111
View File
@@ -0,0 +1,111 @@
name: Prepare Release Apps
permissions: {}
on:
workflow_dispatch:
schedule:
# Triggers every Monday at 5pm Shanghai time (9am UTC)
- cron: "0 9 * * 1"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
prepare:
name: Prepare Release
runs-on: ubuntu-latest
outputs:
pull-request-number: ${{ steps.pr.outputs.pull-request-number }}
oxlint_version: ${{ steps.run.outputs.OXLINT_VERSION }}
oxfmt_version: ${{ steps.run.outputs.OXFMT_VERSION }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
persist-credentials: false
- uses: oxc-project/setup-rust@f03aedf4620c1d3aa169a2510e24787d362bbe0b # v1.0.8
with:
cache-key: warm
tools: cargo-release-oxc
- name: Generate version and changelog
id: run
run: |
cargo release-oxc update --release oxlint --release oxfmt
echo "OXLINT_VERSION=$(cat ./target/OXLINT_VERSION)" >> $GITHUB_OUTPUT
echo "OXFMT_VERSION=$(cat ./target/OXFMT_VERSION)" >> $GITHUB_OUTPUT
{
echo "# Oxlint"
cat ./target/OXLINT_CHANGELOG
echo ""
echo "# Oxfmt"
cat ./target/OXFMT_CHANGELOG
} > ./target/PR_BODY.md
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
- name: Rebuild NAPI bindings
run: |
pnpm --filter oxlint run build-dev
pnpm --filter oxfmt run build-dev
- name: Update Cargo.lock
run: cargo check
- uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
id: pr
with:
# bot account with PAT required for triggering workflow runs
# See https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
token: ${{ secrets.OXC_BOT_PAT }}
commit-message: "release(apps): oxlint v${{ steps.run.outputs.OXLINT_VERSION }} && oxfmt v${{ steps.run.outputs.OXFMT_VERSION }}"
title: "release(apps): oxlint v${{ steps.run.outputs.OXLINT_VERSION }} && oxfmt v${{ steps.run.outputs.OXFMT_VERSION }}"
branch: release/apps
branch-suffix: timestamp
base: main
body-path: ./target/PR_BODY.md
assignees: Boshen
ecosystem-ci:
needs: prepare
name: Trigger Ecosystem CI
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
id: comment
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ needs.prepare.outputs.pull-request-number }}
body: Triggering Ecosystem CI https://github.com/oxc-project/oxlint-ecosystem-ci/actions/workflows/ci.yml
- uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4
with:
repo: oxc-project/oxlint-ecosystem-ci
workflow: ci.yml
token: ${{ secrets.OXC_BOT_PAT }}
ref: main
inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "comment-id": "${{ steps.comment.outputs.comment-id }}" }'
website:
needs: prepare
name: Update oxc.rs
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4
with:
repo: oxc-project/oxc-project.github.io
workflow: release.yml
token: ${{ secrets.OXC_BOT_PAT }}
ref: main
inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "version": "${{ needs.prepare.outputs.oxlint_version }}" }'
+58 -7
View File
@@ -4,6 +4,9 @@ permissions: {}
on:
workflow_dispatch:
schedule:
# Triggers every Monday at 5pm Shanghai time (9am UTC)
- cron: "0 9 * * 1"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
@@ -23,13 +26,61 @@ jobs:
- run: cargo release-oxc publish --release crates --dry-run
prepare:
needs: check
name: Prepare Release Crates
uses: ./.github/workflows/reusable_prepare_release.yml
with:
name: crates
secrets:
OXC_BOT_PAT: ${{ secrets.OXC_BOT_PAT }}
name: Prepare Release
runs-on: ubuntu-latest
outputs:
pull-request-number: ${{ steps.pr.outputs.pull-request-number }}
version: ${{ steps.run.outputs.CRATES_VERSION }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
persist-credentials: false
- uses: oxc-project/setup-rust@f03aedf4620c1d3aa169a2510e24787d362bbe0b # v1.0.8
with:
cache-key: warm
tools: cargo-release-oxc
- name: Run
id: run
run: |
cargo ck
cargo release-oxc update --release crates
echo "CRATES_VERSION=$(cat ./target/CRATES_VERSION)" >> $GITHUB_OUTPUT
{
echo 'CHANGELOG<<EOF'
cat ./target/CRATES_CHANGELOG
echo EOF
} >> $GITHUB_OUTPUT
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
# Run NAPI-RS build, because NAPI-RS uses version from `package.json` in the bindings file,
# which is committed to the repo. The version has just been bumped in previous step.
# We don't use the compiled `.node` binary, so only do a development build, as it's faster.
- name: Rebuild NAPI packages bindings
run: |
pnpm --filter oxc-minify run build-dev
pnpm --filter oxc-parser run build-dev
pnpm --filter oxc-transform run build-dev
- name: Update Cargo.lock
run: cargo check
- uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
id: pr
with:
# bot account with PAT required for triggering workflow runs
# See https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
token: ${{ secrets.OXC_BOT_PAT }}
commit-message: "release(crates): oxc v${{ steps.run.outputs.CRATES_VERSION }}"
title: "release(crates): oxc v${{ steps.run.outputs.CRATES_VERSION }}"
branch: release/crates
branch-suffix: timestamp
base: main
body: ${{ steps.run.outputs.CHANGELOG }}
assignees: Boshen
ecosystem-ci:
needs: prepare
@@ -1,19 +0,0 @@
name: Prepare Release Oxfmt
permissions: {}
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
prepare:
name: Prepare Release Oxfmt
uses: ./.github/workflows/reusable_prepare_release.yml
with:
name: oxfmt
secrets:
OXC_BOT_PAT: ${{ secrets.OXC_BOT_PAT }}
@@ -1,60 +0,0 @@
name: Prepare Release Oxlint
permissions: {}
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
prepare:
name: Prepare Release Oxlint
uses: ./.github/workflows/reusable_prepare_release.yml
with:
name: oxlint
secrets:
OXC_BOT_PAT: ${{ secrets.OXC_BOT_PAT }}
ecosystem-ci:
needs: prepare
name: Trigger Ecosystem CI
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
id: comment
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ needs.prepare.outputs.pull-request-number }}
body: Triggering Ecosystem CI https://github.com/oxc-project/oxlint-ecosystem-ci/actions/workflows/ci.yml
- uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4
with:
repo: oxc-project/oxlint-ecosystem-ci
workflow: ci.yml
token: ${{ secrets.OXC_BOT_PAT }}
ref: main
inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "comment-id": "${{ steps.comment.outputs.comment-id }}" }'
website:
needs: prepare
name: Update oxc.rs
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4
with:
repo: oxc-project/oxc-project.github.io
workflow: release.yml
token: ${{ secrets.OXC_BOT_PAT }}
ref: main
inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "version": "${{ needs.prepare.outputs.version }}" }'
+473
View File
@@ -0,0 +1,473 @@
name: Release Apps
permissions: {}
on:
workflow_dispatch:
push:
branches:
- main
paths:
- npm/oxfmt/package.json
- npm/oxlint/package.json
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: Check version
runs-on: ubuntu-latest
outputs:
version_changed: ${{ steps.oxfmt.outputs.version_changed && steps.oxlint.outputs.version_changed }}
oxfmt_version: ${{ steps.oxfmt.outputs.version }}
oxlint_version: ${{ steps.oxlint.outputs.version }}
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- uses: ./.github/actions/check-version
id: oxfmt
with:
file-name: npm/oxfmt/package.json
file-url: https://unpkg.com/oxfmt@latest/package.json
- uses: ./.github/actions/check-version
id: oxlint
with:
file-name: npm/oxlint/package.json
file-url: https://unpkg.com/oxlint@latest/package.json
build-oxlint:
needs: check
if: needs.check.outputs.version_changed == 'true'
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
code-target: win32-x64
build-oxlint-args: ""
- os: windows-latest
target: aarch64-pc-windows-msvc
code-target: win32-arm64
build-oxlint-args: ""
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
code-target: linux-x64-gnu
build-oxlint-args: --use-napi-cross
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
code-target: linux-arm64-gnu
build-oxlint-args: --use-napi-cross
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
code-target: linux-x64-musl
build-oxlint-args: -x
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
code-target: linux-arm64-musl
build-oxlint-args: -x
- os: macos-latest
target: x86_64-apple-darwin
code-target: darwin-x64
build-oxlint-args: ""
- os: macos-latest
target: aarch64-apple-darwin
code-target: darwin-arm64
build-oxlint-args: ""
name: Build Oxlint ${{ matrix.code-target }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- name: Install cross
uses: taiki-e/install-action@81ee1d48d9194cdcab880cbdc7d36e87d39874cb # v2.62.45
with:
tool: cross # cross installs the latest rust toolchain
# No Rust cache is provided, to avoid cache poisoning attack.
- name: Add Rust Target
run: rustup target add ${{ matrix.target }}
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
# For cargo-zigbuild in musl builds.
- uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1
if: ${{ contains(matrix.target, 'musl') }}
with:
version: 0.13.0
- name: Build oxlint
working-directory: apps/oxlint
run: pnpm run build-napi-release --target ${{ matrix.target }} ${{ matrix.build-oxlint-args }}
shell: bash
env:
TARGET_CC: clang # for mimalloc
- name: Build language server
shell: bash
env:
TARGET_CC: clang # for mimalloc
run: cross build --release -p oxc_language_server --bin oxc_language_server --target=${{ matrix.target }}
# The binaries are zipped to fix permission loss https://github.com/actions/upload-artifact#permission-loss
- name: Archive Binaries
if: runner.os == 'Windows'
# Windows `.node` files have `-msvc` postfix e.g. `oxlint.win32-x64-msvc.node`. Remove the postfix.
run: |
OXLINT_BIN_SRC_NAME=oxlint.${{ matrix.code-target }}-msvc.node
OXLINT_BIN_NAME=oxlint.${{ matrix.code-target }}.node
mv apps/oxlint/src-js/$OXLINT_BIN_SRC_NAME $OXLINT_BIN_NAME
7z a oxlint-${{ matrix.code-target }}.zip $OXLINT_BIN_NAME
OXLS_BIN_NAME=oxc_language_server-${{ matrix.code-target }}
mv target/${{ matrix.target }}/release/oxc_language_server.exe $OXLS_BIN_NAME.exe
7z a $OXLS_BIN_NAME.zip $OXLS_BIN_NAME.exe
# The binaries are zipped to fix permission loss https://github.com/actions/upload-artifact#permission-loss
- name: Archive Binaries
if: runner.os != 'Windows'
run: |
OXLINT_BIN_NAME=oxlint.${{ matrix.code-target }}.node
mv apps/oxlint/src-js/$OXLINT_BIN_NAME .
tar czf oxlint-${{ matrix.code-target }}.tar.gz $OXLINT_BIN_NAME
OXLS_BIN_NAME=oxc_language_server-${{ matrix.code-target }}
mv target/${{ matrix.target }}/release/oxc_language_server $OXLS_BIN_NAME
tar czf $OXLS_BIN_NAME.tar.gz $OXLS_BIN_NAME
- name: Upload Binary
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
if-no-files-found: error
name: oxlint-${{ matrix.code-target }}
path: |
*.zip
*.tar.gz
publish-oxlint:
name: Publish Oxlint
needs: [check, build-oxlint]
runs-on: ubuntu-latest
permissions:
id-token: write # for `pnpm publish --provenance`
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
path: .
pattern: oxlint-*
merge-multiple: true
- run: ls
- name: Unzip from windows builds
uses: montudor/action-zip@0852c26906e00f8a315c704958823928d8018b28 # v1.0.0
with:
args: unzip -qq *.zip -d .
- name: Untar from non-windows builds
run: ls *.gz | xargs -i tar xf {}
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
- name: Generate oxlint JS build
working-directory: apps/oxlint
run: pnpm run build-js
- name: Generate npm packages
run: |
node npm/oxlint/scripts/generate-packages.js
cat npm/oxlint/package.json
for package in npm/oxlint*; do cat $package/package.json ; echo ; done
- run: npm install -g npm@latest # For trusted publishing support
- name: Publish npm packages as latest
# NOTE: The trailing slash on $package/ changes it to publishing the directory
run: |
for package in npm/oxlint*
do
pnpm publish $package/ --provenance --access public --no-git-checks
echo '----'
done
build-oxfmt:
needs: check
if: needs.check.outputs.version_changed == 'true'
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
code-target: win32-x64
build-oxfmt-args: ""
- os: windows-latest
target: aarch64-pc-windows-msvc
code-target: win32-arm64
build-oxfmt-args: ""
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
code-target: linux-x64-gnu
build-oxfmt-args: --use-napi-cross
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
code-target: linux-arm64-gnu
build-oxfmt-args: --use-napi-cross
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
code-target: linux-x64-musl
build-oxfmt-args: -x
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
code-target: linux-arm64-musl
build-oxfmt-args: -x
- os: macos-latest
target: x86_64-apple-darwin
code-target: darwin-x64
build-oxfmt-args: ""
- os: macos-latest
target: aarch64-apple-darwin
code-target: darwin-arm64
build-oxfmt-args: ""
name: Build Oxfmt ${{ matrix.code-target }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- name: Install cross
uses: taiki-e/install-action@81ee1d48d9194cdcab880cbdc7d36e87d39874cb # v2.62.45
with:
tool: cross # cross installs the latest rust toolchain
# No Rust cache is provided, to avoid cache poisoning attack.
- name: Add Rust Target
run: rustup target add ${{ matrix.target }}
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
# For cargo-zigbuild in musl builds.
- uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1
if: ${{ contains(matrix.target, 'musl') }}
with:
version: 0.13.0
- name: Build oxfmt
working-directory: apps/oxfmt
run: pnpm run build-napi-release --target ${{ matrix.target }} ${{ matrix.build-oxfmt-args }}
shell: bash
env:
TARGET_CC: clang # for mimalloc
# The binaries are zipped to fix permission loss https://github.com/actions/upload-artifact#permission-loss
- name: Archive Binaries
if: runner.os == 'Windows'
# Windows `.node` files have `-msvc` postfix e.g. `oxfmt.win32-x64-msvc.node`. Remove the postfix.
run: |
OXFMT_BIN_SRC_NAME=oxfmt.${{ matrix.code-target }}-msvc.node
OXFMT_BIN_NAME=oxfmt.${{ matrix.code-target }}.node
mv apps/oxfmt/src-js/$OXFMT_BIN_SRC_NAME $OXFMT_BIN_NAME
7z a oxfmt-${{ matrix.code-target }}.zip $OXFMT_BIN_NAME
# The binaries are zipped to fix permission loss https://github.com/actions/upload-artifact#permission-loss
- name: Archive Binaries
if: runner.os != 'Windows'
run: |
OXFMT_BIN_NAME=oxfmt.${{ matrix.code-target }}.node
mv apps/oxfmt/src-js/$OXFMT_BIN_NAME .
tar czf oxfmt-${{ matrix.code-target }}.tar.gz $OXFMT_BIN_NAME
- name: Upload Binary
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
if-no-files-found: error
name: oxfmt-${{ matrix.code-target }}
path: |
*.zip
*.tar.gz
publish-oxfmt:
name: Publish Oxfmt
needs: [check, build-oxfmt]
runs-on: ubuntu-latest
permissions:
contents: write # for softprops/action-gh-release@v1.3.1
id-token: write # for `pnpm publish --provenance`
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
path: .
pattern: oxfmt-*
merge-multiple: true
- run: ls
- name: Unzip from windows builds
uses: montudor/action-zip@0852c26906e00f8a315c704958823928d8018b28 # v1.0.0
with:
args: unzip -qq *.zip -d .
- name: Untar from non-windows builds
run: ls *.gz | xargs -i tar xf {}
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
- name: Generate oxfmt JS build
working-directory: apps/oxfmt
run: pnpm run build-js
- name: Generate npm packages
run: |
node npm/oxfmt/scripts/generate-packages.js
cat npm/oxfmt/package.json
for package in npm/oxfmt*; do cat $package/package.json ; echo ; done
- run: npm install -g npm@latest # For trusted publishing support
- name: Publish npm packages as latest
# NOTE: The trailing slash on $package/ changes it to publishing the directory
run: |
for package in npm/oxfmt*
do
pnpm publish $package/ --provenance --access public --no-git-checks
echo '----'
done
github-release:
name: GitHub Release
needs: [check, build-oxlint, build-oxfmt, publish-oxlint, publish-oxfmt]
permissions:
contents: write # for softprops/action-gh-release@v1.3.1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
token: ${{ secrets.OXC_BOT_PAT }}
fetch-depth: 0 # for changelog
persist-credentials: true
- uses: oxc-project/setup-rust@f03aedf4620c1d3aa169a2510e24787d362bbe0b # v1.0.8
with:
restore-cache: false
tools: cargo-release-oxc
- name: Run
id: run
run: |
mkdir -p target
cargo release-oxc changelog --release oxfmt --release oxlint
{
echo '# Oxlint'
echo
cat ./target/OXLINT_CHANGELOG
echo '# Oxfmt'
echo
cat ./target/OXFMT_CHANGELOG
} > ./target/RELEASE_BODY.md
- name: tag oxlint and oxfmt
env:
NEEDS_CHECK_OUTPUTS_OXFMT_VERSION: ${{ needs.check.outputs.oxfmt_version }}
NEEDS_CHECK_OUTPUTS_OXLINT_VERSION: ${{ needs.check.outputs.oxlint_version }}
run: |
git tag oxfmt_v${NEEDS_CHECK_OUTPUTS_OXFMT_VERSION} ${{ github.sha }}
git tag oxlint_v${NEEDS_CHECK_OUTPUTS_OXLINT_VERSION} ${{ github.sha }}
git push origin oxlint_v${NEEDS_CHECK_OUTPUTS_OXLINT_VERSION} oxfmt_v${NEEDS_CHECK_OUTPUTS_OXFMT_VERSION}
- name: Create GitHub Release
uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2.4.1
with:
body_path: ./target/RELEASE_BODY.md
draft: false
name: oxlint v${{ needs.check.outputs.oxlint_version }} & oxfmt v${{ needs.check.outputs.oxfmt_version }}
tag_name: apps_v${{ needs.check.outputs.oxlint_version }}
target_commitish: ${{ github.sha }}
- name: wait 3 minutes for smoke test
run: sleep 180s
smoke:
needs: [check, github-release]
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
- os: ubuntu-latest
- os: ubuntu-latest
container: node:18-alpine # musl
- os: macos-latest
name: Smoke Test ${{ matrix.os }} ${{ matrix.container }}
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
steps:
- name: Test
shell: bash
env:
OXFMT_VERSION: ${{ needs.check.outputs.oxfmt_version }}
OXLINT_VERSION: ${{ needs.check.outputs.oxlint_version }}
run: |
touch test.js
ldd --version || true
npx oxfmt@${OXFMT_VERSION} ./test.js
npx oxlint@${OXLINT_VERSION} ./test.js
bump:
needs: [check, smoke]
name: Bump oxlint dependents
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- name: Bump oxc-project/eslint-plugin-oxlint
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4
with:
repo: oxc-project/eslint-plugin-oxlint
workflow: bump_oxlint.yml
token: ${{ secrets.OXC_BOT_PAT }}
ref: main
inputs: '{ "version": "${{ needs.check.outputs.oxlint_version }}" }'
- name: Bump oxc-project/oxlint-migrate
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4
with:
repo: oxc-project/oxlint-migrate
workflow: bump_oxlint.yml
token: ${{ secrets.OXC_BOT_PAT }}
ref: main
inputs: '{ "version": "${{ needs.check.outputs.oxlint_version }}" }'
- name: Bump oxc-project/mirrors-oxlint
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4
with:
repo: oxc-project/mirrors-oxlint
workflow: main.yml
token: ${{ secrets.OXC_BOT_PAT }}
ref: main
+1 -1
View File
@@ -43,7 +43,7 @@ jobs:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
run: |
cargo release-oxc publish --release crates
echo "TAG=$(cat ./target/OXC_VERSION)" >> $GITHUB_OUTPUT
echo "TAG=$(cat ./target/CRATES_VERSION)" >> $GITHUB_OUTPUT
- name: Tag and Push
env:
-247
View File
@@ -1,247 +0,0 @@
name: Release Oxfmt
permissions: {}
on:
workflow_dispatch:
push:
branches:
- main
paths:
- npm/oxfmt/package.json # Please only commit this file, so we don't need to wait for all the other CI jobs to finish.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: Check version
runs-on: ubuntu-latest
outputs:
version_changed: ${{ steps.check.outputs.version_changed }}
version: ${{ steps.check.outputs.version }}
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- uses: ./.github/actions/check-version
id: check
with:
file-name: npm/oxfmt/package.json
file-url: https://unpkg.com/oxfmt@latest/package.json
build:
needs: check
if: needs.check.outputs.version_changed == 'true'
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
code-target: win32-x64
build-oxfmt-args: ""
- os: windows-latest
target: aarch64-pc-windows-msvc
code-target: win32-arm64
build-oxfmt-args: ""
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
code-target: linux-x64-gnu
build-oxfmt-args: --use-napi-cross
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
code-target: linux-arm64-gnu
build-oxfmt-args: --use-napi-cross
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
code-target: linux-x64-musl
build-oxfmt-args: -x
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
code-target: linux-arm64-musl
build-oxfmt-args: -x
- os: macos-latest
target: x86_64-apple-darwin
code-target: darwin-x64
build-oxfmt-args: ""
- os: macos-latest
target: aarch64-apple-darwin
code-target: darwin-arm64
build-oxfmt-args: ""
name: Package ${{ matrix.code-target }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
OXC_VERSION: ${{ needs.check.outputs.version }}
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- name: Install cross
uses: taiki-e/install-action@81ee1d48d9194cdcab880cbdc7d36e87d39874cb # v2.62.45
with:
tool: cross
- name: Rust Cache
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
# Please do not set a cache for release builds; they are evicted before they can be re-used, yet they consume significant cache storage before eviction.
- name: Add Rust Target
run: rustup target add ${{ matrix.target }}
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
- uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1
if: ${{ contains(matrix.target, 'musl') }}
with:
version: 0.13.0
- name: Build oxfmt
working-directory: apps/oxfmt
run: pnpm run build-napi-release --target ${{ matrix.target }} ${{ matrix.build-oxfmt-args }}
shell: bash
env:
TARGET_CC: clang # for mimalloc
# The binaries are zipped to fix permission loss https://github.com/actions/upload-artifact#permission-loss
- name: Archive Binaries
if: runner.os == 'Windows'
# Windows `.node` files have `-msvc` postfix e.g. `oxfmt.win32-x64-msvc.node`. Remove the postfix.
run: |
OXFMT_BIN_SRC_NAME=oxfmt.${{ matrix.code-target }}-msvc.node
OXFMT_BIN_NAME=oxfmt.${{ matrix.code-target }}.node
mv apps/oxfmt/src-js/$OXFMT_BIN_SRC_NAME $OXFMT_BIN_NAME
7z a oxfmt-${{ matrix.code-target }}.zip $OXFMT_BIN_NAME
# The binaries are zipped to fix permission loss https://github.com/actions/upload-artifact#permission-loss
- name: Archive Binaries
if: runner.os != 'Windows'
run: |
OXFMT_BIN_NAME=oxfmt.${{ matrix.code-target }}.node
mv apps/oxfmt/src-js/$OXFMT_BIN_NAME .
tar czf oxfmt-${{ matrix.code-target }}.tar.gz $OXFMT_BIN_NAME
- name: Upload Binary
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
if-no-files-found: error
name: binaries-${{ matrix.code-target }}
path: |
*.zip
*.tar.gz
publish:
name: Publish
needs: [check, build]
runs-on: ubuntu-latest
permissions:
contents: write # for softprops/action-gh-release@v1.3.1
id-token: write # for `pnpm publish --provenance`
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0 # for changelog
persist-credentials: false
- uses: oxc-project/setup-rust@f03aedf4620c1d3aa169a2510e24787d362bbe0b # v1.0.8
with:
restore-cache: false
tools: cargo-release-oxc
- name: Run
id: run
run: |
mkdir -p target
cargo release-oxc changelog --release oxfmt
{
echo 'CHANGELOG<<EOF'
cat ./target/OXC_CHANGELOG
echo EOF
} >> $GITHUB_OUTPUT
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
merge-multiple: true
- name: Unzip
uses: montudor/action-zip@0852c26906e00f8a315c704958823928d8018b28 # v1.0.0
with:
args: unzip -qq *.zip -d .
- name: Untar
run: ls *.gz | xargs -i tar xf {}
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
- name: Generate oxfmt JS build
working-directory: apps/oxfmt
run: pnpm run build-js
- name: Generate npm packages
run: |
node npm/oxfmt/scripts/generate-packages.js
cat npm/oxfmt/package.json
for package in npm/oxfmt*; do cat $package/package.json ; echo ; done
- run: npm install -g npm@latest # For trusted publishing support
- name: Publish npm packages as latest
# NOTE: The trailing slash on $package/ changes it to publishing the directory
run: |
for package in npm/oxfmt*
do
pnpm publish $package/ --provenance --access public --no-git-checks
echo '----'
done
- name: Create GitHub Release
uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2.4.1
with:
body: ${{ steps.run.outputs.CHANGELOG }}
prerelease: true
draft: false
name: oxfmt v${{ needs.check.outputs.version }}
tag_name: oxfmt_v${{ needs.check.outputs.version }}
target_commitish: ${{ github.sha }}
- name: wait 3 minutes for smoke test
run: sleep 180s
smoke:
needs: [check, publish]
strategy:
matrix:
include:
- os: windows-latest
is-windows: true
- os: ubuntu-latest
- os: ubuntu-latest
container: node:18-alpine # musl
- os: macos-latest
name: Smoke Test ${{ matrix.os }} ${{ matrix.container }}
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
steps:
- run: touch test.js
- name: Test (Unix)
if: ${{ !matrix.is-windows }}
env:
OXFMT_VERSION: ${{ needs.check.outputs.version }}
run: |
ldd --version || true
npx oxfmt@${OXFMT_VERSION} ./test.js
- name: Test (Windows)
if: ${{ matrix.is-windows }}
env:
OXFMT_VERSION: ${{ needs.check.outputs.version }}
run: npx oxfmt@$env:OXFMT_VERSION ./test.js
-293
View File
@@ -1,293 +0,0 @@
name: Release Oxlint
permissions: {}
on:
workflow_dispatch:
push:
branches:
- main
paths:
- npm/oxlint/package.json # Please only commit this file, so we don't need to wait for all the other CI jobs to finish.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: Check version
runs-on: ubuntu-latest
outputs:
version_changed: ${{ steps.check.outputs.version_changed }}
version: ${{ steps.check.outputs.version }}
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- uses: ./.github/actions/check-version
id: check
with:
file-name: npm/oxlint/package.json
file-url: https://unpkg.com/oxlint@latest/package.json
build:
needs: check
if: needs.check.outputs.version_changed == 'true'
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
code-target: win32-x64
build-oxlint-args: ""
- os: windows-latest
target: aarch64-pc-windows-msvc
code-target: win32-arm64
build-oxlint-args: ""
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
code-target: linux-x64-gnu
build-oxlint-args: --use-napi-cross
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
code-target: linux-arm64-gnu
build-oxlint-args: --use-napi-cross
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
code-target: linux-x64-musl
build-oxlint-args: -x
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
code-target: linux-arm64-musl
build-oxlint-args: -x
- os: macos-latest
target: x86_64-apple-darwin
code-target: darwin-x64
build-oxlint-args: ""
- os: macos-latest
target: aarch64-apple-darwin
code-target: darwin-arm64
build-oxlint-args: ""
name: Package ${{ matrix.code-target }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
OXC_VERSION: ${{ needs.check.outputs.version }}
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- name: Install cross
uses: taiki-e/install-action@81ee1d48d9194cdcab880cbdc7d36e87d39874cb # v2.62.45
with:
tool: cross
- name: Rust Cache
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
# Please do not set a cache for release builds; they are evicted before they can be re-used, yet they consume significant cache storage before eviction.
- name: Add Rust Target
run: rustup target add ${{ matrix.target }}
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
- uses: goto-bus-stop/setup-zig@abea47f85e598557f500fa1fd2ab7464fcb39406 # v2.2.1
if: ${{ contains(matrix.target, 'musl') }}
with:
version: 0.13.0
- name: Build oxlint
working-directory: apps/oxlint
run: pnpm run build-napi-release --target ${{ matrix.target }} ${{ matrix.build-oxlint-args }}
shell: bash
env:
TARGET_CC: clang # for mimalloc
- name: Build language server
shell: bash
env:
TARGET_CC: clang # for mimalloc
run: cross build --release -p oxc_language_server --bin oxc_language_server --target=${{ matrix.target }}
# The binaries are zipped to fix permission loss https://github.com/actions/upload-artifact#permission-loss
- name: Archive Binaries
if: runner.os == 'Windows'
# Windows `.node` files have `-msvc` postfix e.g. `oxlint.win32-x64-msvc.node`. Remove the postfix.
run: |
OXLINT_BIN_SRC_NAME=oxlint.${{ matrix.code-target }}-msvc.node
OXLINT_BIN_NAME=oxlint.${{ matrix.code-target }}.node
mv apps/oxlint/src-js/$OXLINT_BIN_SRC_NAME $OXLINT_BIN_NAME
7z a oxlint-${{ matrix.code-target }}.zip $OXLINT_BIN_NAME
OXLS_BIN_NAME=oxc_language_server-${{ matrix.code-target }}
mv target/${{ matrix.target }}/release/oxc_language_server.exe $OXLS_BIN_NAME.exe
7z a $OXLS_BIN_NAME.zip $OXLS_BIN_NAME.exe
# The binaries are zipped to fix permission loss https://github.com/actions/upload-artifact#permission-loss
- name: Archive Binaries
if: runner.os != 'Windows'
run: |
OXLINT_BIN_NAME=oxlint.${{ matrix.code-target }}.node
mv apps/oxlint/src-js/$OXLINT_BIN_NAME .
tar czf oxlint-${{ matrix.code-target }}.tar.gz $OXLINT_BIN_NAME
OXLS_BIN_NAME=oxc_language_server-${{ matrix.code-target }}
mv target/${{ matrix.target }}/release/oxc_language_server $OXLS_BIN_NAME
tar czf $OXLS_BIN_NAME.tar.gz $OXLS_BIN_NAME
- name: Upload Binary
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
if-no-files-found: error
name: binaries-${{ matrix.code-target }}
path: |
*.zip
*.tar.gz
publish:
name: Publish
needs: [check, build]
runs-on: ubuntu-latest
permissions:
contents: write # for softprops/action-gh-release@v1.3.1
id-token: write # for `pnpm publish --provenance`
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0 # for changelog
persist-credentials: false
- uses: oxc-project/setup-rust@f03aedf4620c1d3aa169a2510e24787d362bbe0b # v1.0.8
with:
restore-cache: false
tools: cargo-release-oxc
- name: Run
id: run
run: |
mkdir -p target
cargo release-oxc changelog --release oxlint
{
echo 'CHANGELOG<<EOF'
cat ./target/OXC_CHANGELOG
echo EOF
} >> $GITHUB_OUTPUT
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
merge-multiple: true
- name: Unzip
uses: montudor/action-zip@0852c26906e00f8a315c704958823928d8018b28 # v1.0.0
with:
args: unzip -qq *.zip -d .
- name: Untar
run: ls *.gz | xargs -i tar xf {}
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
- name: Generate oxlint JS build
working-directory: apps/oxlint
run: pnpm run build-js
- name: Generate npm packages
run: |
node npm/oxlint/scripts/generate-packages.js
cat npm/oxlint/package.json
for package in npm/oxlint*; do cat $package/package.json ; echo ; done
- run: npm install -g npm@latest # For trusted publishing support
- name: Publish npm packages as latest
# NOTE: The trailing slash on $package/ changes it to publishing the directory
run: |
for package in npm/oxlint*
do
pnpm publish $package/ --provenance --access public --no-git-checks
echo '----'
done
- name: Create GitHub Release
uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2.4.1
with:
body: ${{ steps.run.outputs.CHANGELOG }}
draft: false
name: oxlint v${{ needs.check.outputs.version }}
tag_name: oxlint_v${{ needs.check.outputs.version }}
target_commitish: ${{ github.sha }}
- name: wait 3 minutes for smoke test
run: sleep 180s
smoke:
needs: [check, publish]
strategy:
matrix:
include:
- os: windows-latest
is-windows: true
- os: ubuntu-latest
- os: ubuntu-latest
container: node:18-alpine # musl
- os: macos-latest
name: Smoke Test ${{ matrix.os }} ${{ matrix.container }}
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
steps:
- run: touch test.js
- name: Test (Unix)
if: ${{ !matrix.is-windows }}
env:
OXLINT_VERSION: ${{ needs.check.outputs.version}}
run: |
ldd --version || true
npx oxlint@${OXLINT_VERSION} ./test.js
- name: Test (Windows)
if: ${{ matrix.is-windows }}
env:
OXLINT_VERSION: ${{ needs.check.outputs.version}}
run: npx oxlint@$env:OXLINT_VERSION ./test.js
bump:
needs: [check, publish, smoke]
name: Bump oxlint dependents
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
- name: Bump oxc-project/eslint-plugin-oxlint
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4
with:
repo: oxc-project/eslint-plugin-oxlint
workflow: bump_oxlint.yml
token: ${{ secrets.OXC_BOT_PAT }}
ref: main
inputs: '{ "version": "${{ needs.check.outputs.version }}" }'
- name: Bump oxc-project/oxlint-migrate
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4
with:
repo: oxc-project/oxlint-migrate
workflow: bump_oxlint.yml
token: ${{ secrets.OXC_BOT_PAT }}
ref: main
inputs: '{ "version": "${{ needs.check.outputs.version }}" }'
- name: Bump oxc-project/mirrors-oxlint
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4
with:
repo: oxc-project/mirrors-oxlint
workflow: main.yml
token: ${{ secrets.OXC_BOT_PAT }}
ref: main
@@ -1,85 +0,0 @@
name: Prepare Release
permissions: {}
on:
workflow_call:
inputs:
name:
required: true
type: string
description: "The name defined in oxc_release.toml"
secrets:
OXC_BOT_PAT:
required: true
outputs:
pull-request-number:
value: ${{ jobs.run.outputs.pull-request-number }}
version:
value: ${{ jobs.run.outputs.version }}
jobs:
run:
name: Prepare Release
runs-on: ubuntu-latest
outputs:
pull-request-number: ${{ steps.pr.outputs.pull-request-number }}
version: ${{ steps.run.outputs.VERSION }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
persist-credentials: false
- uses: oxc-project/setup-rust@f03aedf4620c1d3aa169a2510e24787d362bbe0b # v1.0.8
with:
cache-key: warm
tools: cargo-release-oxc
- name: Run
id: run
env:
RELEASE_NAME: ${{ inputs.name }}
run: |
cargo ck
cargo release-oxc update --release ${RELEASE_NAME}
echo "VERSION=$(cat ./target/OXC_VERSION)" >> $GITHUB_OUTPUT
{
echo 'CHANGELOG<<EOF'
cat ./target/OXC_CHANGELOG
echo EOF
} >> $GITHUB_OUTPUT
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
if: ${{ inputs.name == 'crates' || inputs.name == 'oxlint' }}
# Run NAPI-RS build, because NAPI-RS uses version from `package.json` in the bindings file,
# which is committed to the repo. The version has just been bumped in previous step.
# We don't use the compiled `.node` binary, so only do a development build, as it's faster.
- name: Rebuild NAPI packages bindings
if: ${{ inputs.name == 'crates' }}
run: |
pnpm --filter oxc-minify run build-dev
pnpm --filter oxc-parser run build-dev
pnpm --filter oxc-transform run build-dev
- name: Rebuild Oxlint NAPI bindings
if: ${{ inputs.name == 'oxlint' }}
run: pnpm --filter oxlint run build-dev
# update `Cargo.lock`
- run: cargo check
- uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
id: pr
with:
# bot account with PAT required for triggering workflow runs
# See https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs
token: ${{ secrets.OXC_BOT_PAT }}
commit-message: "chore(release): ${{ inputs.name }}) v${{ steps.run.outputs.VERSION }}"
branch: release/${{ inputs.name }}
branch-suffix: timestamp
base: main
title: "release(${{ inputs.name }}): v${{ steps.run.outputs.VERSION }}"
body: ${{ steps.run.outputs.CHANGELOG }}
assignees: Boshen
+1
View File
@@ -91,4 +91,5 @@ commit_parsers = [
{ body = ".*security", group = "<!-- 7 -->🛡️ Security" },
# { message = "^revert", group = "<!-- 8 -->◀️ Revert" },
# { message = ".*", group = "<!-- 9 -->💼 Other" },
{ message = ".*", skip = true },
]