oxc/.github/workflows/release_cli.yml
dependabot[bot] aa1277caed
chore(deps): bump EndBug/version-check from 1 to 2 (#825)
Bumps [EndBug/version-check](https://github.com/endbug/version-check)
from 1 to 2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/endbug/version-check/releases">EndBug/version-check's
releases</a>.</em></p>
<blockquote>
<h2>v2.0.0</h2>
<p>From now on, the <code>changed</code> output will always be either
<code>'true'</code> or <code>'false'</code>, and never
<code>undefined</code>.</p>
<h2>v1.6.0</h2>
<p>You can now use the <code>::before</code> tag in private repos (PR <a
href="https://redirect.github.com/endbug/version-check/issues/27">#27</a>)</p>
<h2>v1.5.0</h2>
<p>You can now use <code>::before</code> as the <code>file-url</code>
parameter: it will resolve to the file from the commit before the push
event that triggered the workflow run.
Also, this repo now follows the All Contributors specifications </p>
<h2>v1.4.0</h2>
<p>This version adds three new options: <code>file-url</code>,
<code>assume-same-version</code> and <code>static-checking</code>.
Please see the README to find out how to use them.
As always, if you find any bugs please let me know by opening a new
issue in this repo.</p>
<h2>v1.3.0</h2>
<p>This version adds two features:</p>
<ul>
<li>The action can now be used with PRs</li>
<li>The action now has a <code>commit</code> output, from which you can
grab the sha of the commit where the version change has been
detected</li>
</ul>
<h2>v1.2.2</h2>
<p>This makes the action automatically build with
<code>@zeit/ncc</code>. No significant changes should be noticed by the
end user, if not a slight improvement in performance.</p>
<h2>v1.2.1</h2>
<p>This patch fixes issue <a
href="https://redirect.github.com/endbug/version-check/issues/11">#11</a>:
the action wasn't detecting versions with a more complex format, like
<code>1.2.3-alpha.10.beta.0+build.unicorn.rainbow</code>, because it was
stopping at the patch number (<code>1.2.3</code>). This should now be
fixed</p>
<h2>v1.2.0</h2>
<p>This release adds the <code>version</code> output: it's a string with
the new version, and can be used to, for example, create a new release
with the version name.</p>
<h2>v1.1.1</h2>
<p>This release is just to add the major version tag <code>v1</code>,
which can be used to keep the action updated while avoiding breaking
changes.</p>
<h2>v1.1.0</h2>
<p>This version adds support for private repositories, you just need to
pass the bearer GitHub token as an input. You can find more info about
that on the action page.</p>
<h2>v1.0.1</h2>
<p>This adds a useful example if you want to use this action to publish
your package to both NPM and GitHub Package Registry.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="323ba664f1"><code>323ba66</code></a>
2.1.1</li>
<li><a
href="6d2f38ddd5"><code>6d2f38d</code></a>
docs: add Gerrit0 as a contributor for code (<a
href="https://redirect.github.com/endbug/version-check/issues/185">#185</a>)</li>
<li><a
href="82e9bfe44e"><code>82e9bfe</code></a>
Update to Node 16 (<a
href="https://redirect.github.com/endbug/version-check/issues/184">#184</a>)</li>
<li><a
href="d2a27886f3"><code>d2a2788</code></a>
chore(deps-dev): bump all-contributors-cli from 6.22.0 to 6.23.1 (<a
href="https://redirect.github.com/endbug/version-check/issues/183">#183</a>)</li>
<li><a
href="dc6b9cdf68"><code>dc6b9cd</code></a>
[auto] build: update compiled version</li>
<li><a
href="9dda8f6b23"><code>9dda8f6</code></a>
chore(deps-dev): bump all-contributors-cli from 6.20.5 to 6.22.0 (<a
href="https://redirect.github.com/endbug/version-check/issues/182">#182</a>)</li>
<li><a
href="1da399082b"><code>1da3990</code></a>
chore(deps): bump <code>@​actions/core</code> from 1.9.1 to 1.10.0 (<a
href="https://redirect.github.com/endbug/version-check/issues/181">#181</a>)</li>
<li><a
href="254e871301"><code>254e871</code></a>
chore(deps-dev): bump typescript from 4.8.3 to 4.8.4 (<a
href="https://redirect.github.com/endbug/version-check/issues/180">#180</a>)</li>
<li><a
href="e3c71fe61d"><code>e3c71fe</code></a>
chore(deps-dev): bump all-contributors-cli from 6.20.4 to 6.20.5 (<a
href="https://redirect.github.com/endbug/version-check/issues/179">#179</a>)</li>
<li><a
href="e285746efc"><code>e285746</code></a>
chore(deps-dev): bump all-contributors-cli from 6.20.0 to 6.20.4 (<a
href="https://redirect.github.com/endbug/version-check/issues/178">#178</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/endbug/version-check/compare/v1...v2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=EndBug/version-check&package-manager=github_actions&previous-version=1&new-version=2)](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>
2023-09-01 11:39:38 +08:00

180 lines
5.3 KiB
YAML

name: Release CLI
# When main is pushed and npm/oxc/package.json has been changed,
# trigger the jobs after the ci workflow has been passed.
on:
push:
branches:
- main
paths:
- npm/oxc/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@v3
- name: Check version changes
uses: EndBug/version-check@v2
id: version
with:
static-checking: localIsNew
file-url: https://unpkg.com/oxidation-compiler@latest/package.json
file-name: npm/oxc/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:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
code-target: win32-x64
- os: windows-latest
target: aarch64-pc-windows-msvc
code-target: win32-arm64
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
code-target: linux-x64
- os: ubuntu-20.04
target: aarch64-unknown-linux-gnu
code-target: linux-arm64
- 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.code-target }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Rust toolchain
run: rustup target add ${{ matrix.target }}
- name: Install arm64 toolchain
if: matrix.code-target == 'linux-arm64'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: release-${{ matrix.target }}
- name: Build Binary
# strip debug symbols from std, see https://github.com/johnthagen/min-sized-rust#remove-panic-string-formatting-with-panic_immediate_abort
run: cargo build --release --target ${{ matrix.target }} -p oxc_cli
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
# 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: |
BIN_NAME=oxc-${{ matrix.code-target }}
mv target/${{ matrix.target }}/release/oxc_cli.exe $BIN_NAME.exe
7z a $BIN_NAME.zip $BIN_NAME.exe
# The binary is zipped to fix permission loss https://github.com/actions/upload-artifact#permission-loss
- name: Archive Binary
if: runner.os != 'Windows'
run: |
BIN_NAME=oxc-${{ matrix.code-target }}
mv target/${{ matrix.target }}/release/oxc_cli $BIN_NAME
tar czf $BIN_NAME.tar.gz $BIN_NAME
- name: Upload Binary
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: binaries
path: |
*.zip
*.tar.gz
publish:
name: Publish
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@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: binaries
- name: Unzip
uses: montudor/action-zip@v1
with:
args: unzip -qq *.zip -d .
- name: Untar
run: ls *.gz | xargs -i tar xf {}
- name: Generate npm packages
run: |
node npm/oxc/scripts/generate-packages.mjs
cat npm/oxc/package.json
for package in npm/oxc*; do 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: |
for package in npm/oxc*
do
npm publish $package/ --tag latest --provenance --access public
echo '----'
done
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
name: CLI v${{ needs.build.outputs.version }}
draft: true
files: oxc-*
fail_on_unmatched_files: true
generate_release_notes: true