mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/upload-artifact/releases">actions/upload-artifact's releases</a>.</em></p> <blockquote> <h2>v4.0.0</h2> <h2>What's Changed</h2> <p>The release of upload-artifact@v4 and download-artifact@v4 are major changes to the backend architecture of Artifacts. They have numerous performance and behavioral improvements.</p> <p>For more information, see the <a href="https://github.com/actions/toolkit/tree/main/packages/artifact"><code>@actions/artifact</code></a> documentation.</p> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/vmjoseph"><code>@vmjoseph</code></a> made their first contribution in <a href="https://redirect.github.com/actions/upload-artifact/pull/464">actions/upload-artifact#464</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/upload-artifact/compare/v3...v4.0.0">https://github.com/actions/upload-artifact/compare/v3...v4.0.0</a></p> <h2>v3.1.3</h2> <h2>What's Changed</h2> <ul> <li>chore(github): remove trailing whitespaces by <a href="https://github.com/ljmf00"><code>@ljmf00</code></a> in <a href="https://redirect.github.com/actions/upload-artifact/pull/313">actions/upload-artifact#313</a></li> <li>Bump <code>@actions/artifact</code> version to v1.1.2 by <a href="https://github.com/bethanyj28"><code>@bethanyj28</code></a> in <a href="https://redirect.github.com/actions/upload-artifact/pull/436">actions/upload-artifact#436</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/upload-artifact/compare/v3...v3.1.3">https://github.com/actions/upload-artifact/compare/v3...v3.1.3</a></p> <h2>v3.1.2</h2> <ul> <li>Update all <code>@actions/*</code> NPM packages to their latest versions- <a href="https://redirect.github.com/actions/upload-artifact/issues/374">#374</a></li> <li>Update all dev dependencies to their most recent versions - <a href="https://redirect.github.com/actions/upload-artifact/issues/375">#375</a></li> </ul> <h2>v3.1.1</h2> <ul> <li>Update actions/core package to latest version to remove <code>set-output</code> deprecation warning <a href="https://redirect.github.com/actions/upload-artifact/issues/351">#351</a></li> </ul> <h2>v3.1.0</h2> <h2>What's Changed</h2> <ul> <li>Bump <code>@actions/artifact</code> to v1.1.0 (<a href="https://redirect.github.com/actions/upload-artifact/pull/327">actions/upload-artifact#327</a>) <ul> <li>Adds checksum headers on artifact upload (<a href="https://redirect.github.com/actions/toolkit/pull/1095">actions/toolkit#1095</a>) (<a href="https://redirect.github.com/actions/toolkit/pull/1063">actions/toolkit#1063</a>)</li> </ul> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="c7d193f32e"><code>c7d193f</code></a> Merge pull request <a href="https://redirect.github.com/actions/upload-artifact/issues/466">#466</a> from actions/v4-beta</li> <li><a href="13131bb095"><code>13131bb</code></a> licensed cache</li> <li><a href="4a6c273b98"><code>4a6c273</code></a> Merge branch 'main' into v4-beta</li> <li><a href="f391bb91a3"><code>f391bb9</code></a> Merge pull request <a href="https://redirect.github.com/actions/upload-artifact/issues/465">#465</a> from actions/robherley/v4-documentation</li> <li><a href="9653d03c4b"><code>9653d03</code></a> Apply suggestions from code review</li> <li><a href="875b630764"><code>875b630</code></a> add limitations section</li> <li><a href="ecb21463e9"><code>ecb2146</code></a> add compression example</li> <li><a href="5e7604f84a"><code>5e7604f</code></a> trim some repeated info</li> <li><a href="d6437d0758"><code>d6437d0</code></a> naming</li> <li><a href="1b56155703"><code>1b56155</code></a> s/v4-beta/v4/g</li> <li>Additional commits viewable in <a href="https://github.com/actions/upload-artifact/compare/v3...v4">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
180 lines
5.2 KiB
YAML
180 lines
5.2 KiB
YAML
name: Release NAPI Parser
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- npm/oxc-parser/package.json # Please only commit this file, so we don't need to wait for test CI to pass.
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
check:
|
|
name: Check version
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
version: ${{ env.version }}
|
|
version_changed: ${{ steps.version.outputs.changed }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Check version changes
|
|
uses: EndBug/version-check@v2
|
|
id: version
|
|
with:
|
|
static-checking: localIsNew
|
|
file-url: https://unpkg.com/oxc-parser@latest/package.json
|
|
file-name: npm/oxc-parser/package.json
|
|
|
|
- name: Set version name
|
|
if: steps.version.outputs.changed == 'true'
|
|
run: |
|
|
echo "Version change found! New version: ${{ steps.version.outputs.version }} (${{ steps.version.outputs.version_type }})"
|
|
echo "version=${{ steps.version.outputs.version }}" >> $GITHUB_ENV
|
|
|
|
build:
|
|
needs: check
|
|
if: needs.check.outputs.version_changed == 'true'
|
|
env:
|
|
version: ${{ needs.check.outputs.version }}
|
|
outputs:
|
|
version: ${{ env.version }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: windows-latest
|
|
target: x86_64-pc-windows-msvc
|
|
code-target: win32-x64-msvc
|
|
|
|
- os: windows-latest
|
|
target: aarch64-pc-windows-msvc
|
|
code-target: win32-arm64-msvc
|
|
|
|
- os: ubuntu-latest
|
|
target: x86_64-unknown-linux-gnu
|
|
code-target: linux-x64-gnu
|
|
|
|
- os: ubuntu-latest
|
|
target: aarch64-unknown-linux-gnu
|
|
code-target: linux-arm64-gnu
|
|
|
|
- os: macos-latest
|
|
target: x86_64-apple-darwin
|
|
code-target: darwin-x64
|
|
|
|
- os: macos-latest
|
|
target: aarch64-apple-darwin
|
|
code-target: darwin-arm64
|
|
|
|
name: Package ${{ matrix.target }}
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install cross
|
|
uses: taiki-e/install-action@cross
|
|
|
|
- name: Add Rust Target
|
|
run: rustup target add ${{ matrix.target }}
|
|
|
|
- name: Build with cross
|
|
run: cross build -p oxc_napi_parser --release --target=${{ matrix.target }}
|
|
|
|
- name: Move file on ${{ matrix.os }}
|
|
shell: bash
|
|
run: |
|
|
shopt -s extglob
|
|
ls target/${{ matrix.target }}/release/*.@(so|dll|dylib)
|
|
mv target/${{ matrix.target }}/release/*.@(so|dll|dylib) napi/parser/parser.${{ matrix.code-target }}.node
|
|
ls napi/parser
|
|
|
|
- name: Test
|
|
working-directory: napi/parser
|
|
if: ${{ contains(matrix.target, 'x86') }} # Need docker for aarch64
|
|
run: |
|
|
ls
|
|
node test.mjs
|
|
|
|
# The binary is zipped to fix permission loss https://github.com/actions/upload-artifact#permission-loss
|
|
- name: Archive Binary
|
|
if: runner.os == 'Windows'
|
|
shell: bash
|
|
run: 7z a ${{ matrix.code-target }}.zip napi/parser/parser.${{ matrix.code-target }}.node
|
|
|
|
# The binary is zipped to fix permission loss https://github.com/actions/upload-artifact#permission-loss
|
|
- name: Archive Binary
|
|
if: runner.os != 'Windows'
|
|
shell: bash
|
|
run: tar czf ${{ matrix.code-target }}.tar.gz napi/parser/parser.${{ matrix.code-target }}.node
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
if-no-files-found: error
|
|
name: binaries
|
|
path: |
|
|
*.zip
|
|
*.tar.gz
|
|
|
|
publish:
|
|
name: Publish NAPI
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write # for softprops/action-gh-release@v1
|
|
id-token: write # for `npm publish --provenance`
|
|
needs:
|
|
- build
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 18
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- name: Download Artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: binaries
|
|
|
|
- name: Unzip
|
|
uses: montudor/action-zip@v1
|
|
with:
|
|
args: unzip -qq *.zip -d .
|
|
|
|
- name: Untar
|
|
shell: bash
|
|
run: ls *.gz | xargs -i tar xvf {}
|
|
|
|
- name: Generate npm packages
|
|
shell: bash
|
|
run: |
|
|
ls
|
|
ls napi/parser
|
|
node npm/oxc-parser/scripts/generate-packages.mjs
|
|
cat npm/oxc-parser/package.json
|
|
for package in npm/oxc-parser*
|
|
do
|
|
ls $package
|
|
cat $package/package.json
|
|
echo '----'
|
|
done
|
|
|
|
- name: Publish npm packages as latest
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
shell: bash
|
|
# NOTE: The trailing slash on $package/ changes it to publishing the directory
|
|
run: |
|
|
# publish subpackages first
|
|
for package in npm/oxc-parser-*
|
|
do
|
|
npm publish $package/ --tag latest --provenance --access public
|
|
done
|
|
# publish root package last
|
|
npm publish npm/oxc-parser/ --tag latest --provenance --access public
|