Skip to content

refactor(es/minifier): Remove useless helpers (#12343) #2114

refactor(es/minifier): Remove useless helpers (#12343)

refactor(es/minifier): Remove useless helpers (#12343) #2114

name: "Publish crates (auto)"
env:
CI: 1
# 7 GiB by default on GitHub, setting to 6 GiB
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
NODE_OPTIONS: --max-old-space-size=6144
GIT_AUTHOR_NAME: "SWC Bot"
GIT_AUTHOR_EMAIL: "bot@swc.rs"
GIT_COMMITTER_NAME: "SWC Bot"
GIT_COMMITTER_EMAIL: "bot@swc.rs"
permissions: {}
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
publish-cargo:
# Run only on `chore: Publish` prefix
name: "Publish cargo crates"
runs-on: ubuntu-latest
environment: publish
permissions:
contents: read
id-token: write
if: >-
${{ github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, 'chore: Publish') }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
persist-credentials: false
- uses: ./.github/actions/setup-node
with:
cache: "false"
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
- name: Install cargo-edit
uses: taiki-e/install-action@3235f8901fd37ffed0052b276cec25a362fb82e9 # v2.77.7
with:
tool: cargo-edit@0.12.2
- name: Install cargo-mono
uses: taiki-e/install-action@3235f8901fd37ffed0052b276cec25a362fb82e9 # v2.77.7
with:
tool: cargo-mono@0.6.9
- name: Update constant of swc_core
run: npx ts-node .github/bot/src/cargo/update-constants.ts
- name: Authenticate with crates.io
id: crates-io-auth
uses: rust-lang/crates-io-auth-action@bbd81622f20ce9e2dd9622e3218b975523e45bbe # v1.0.4
- name: Publish crates
env:
CARGO_REGISTRY_TOKEN: ${{ steps.crates-io-auth.outputs.token }}
run: |
cargo mono publish --allow-dirty