Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
35e68a3
fix: build functional again
ScriptedAlchemy Jun 23, 2025
cd98739
feat: streamline ConsumeShared tree-shaking implementation
ScriptedAlchemy Jun 23, 2025
db5e256
refactor(mf): Remove unused share usage plugins and update docs
ScriptedAlchemy Jun 24, 2025
ac2fb20
docs: enhance ConsumeShared macro solution with comprehensive ESM sup…
ScriptedAlchemy Jun 24, 2025
609cb51
docs: refactor system flow diagram to focus on code architecture
ScriptedAlchemy Jun 24, 2025
1f20546
docs: add comprehensive implementation checklist for ConsumeShared ma…
ScriptedAlchemy Jun 24, 2025
65b7baa
docs: enhance implementation checklist with missing critical details
ScriptedAlchemy Jun 24, 2025
883925e
docs: add critical pre-implementation analysis and missing template m…
ScriptedAlchemy Jun 24, 2025
76776dd
docs: verify and update Phase 1 analysis results in implementation ch…
ScriptedAlchemy Jun 24, 2025
3bfc252
docs: add comprehensive missing implementation items to checklist
ScriptedAlchemy Jun 24, 2025
4e38097
fix: implement leading comma strategy for CommonJS object literals
ScriptedAlchemy Jun 24, 2025
5c40830
fix: attempt to resolve comma positioning in CommonJS macro exports
ScriptedAlchemy Jun 24, 2025
0fe1bf9
fix: resolve comma positioning in CommonJS macro exports
ScriptedAlchemy Jun 26, 2025
3f47da4
fix: correct CommonJS macro positioning for tree-shaking compatibility
ScriptedAlchemy Jun 27, 2025
9a66910
fix: remove unused function and complete macro positioning fix
ScriptedAlchemy Jun 27, 2025
c8ea675
fix: complete CommonJS macro positioning implementation
ScriptedAlchemy Jun 27, 2025
112811d
fix: resolve CommonJS object literal property macro wrapping
ScriptedAlchemy Jun 27, 2025
81c3355
test: update test cases for improved CommonJS macro positioning
ScriptedAlchemy Jun 28, 2025
c6a8b9f
Merge remote-tracking branch 'origin/main' into treeshake-fix
ScriptedAlchemy Jun 28, 2025
95856c3
fix: update method signature for get_module_evaluation_side_effects_s…
ScriptedAlchemy Jun 28, 2025
e30243c
fix: update test expectations for valid multiline macro positioning
ScriptedAlchemy Jun 28, 2025
2e00667
chore: add test reports and macro positioning data
ScriptedAlchemy Jun 28, 2025
e0d7943
test: verify tree-shaking functionality passes all tests
ScriptedAlchemy Jun 28, 2025
8a37f96
Merge treeshake-macro into treeshake-fix to sync branches
ScriptedAlchemy Jun 30, 2025
baf69fe
fix: remove debug logging and convert integration test to rstest format
ScriptedAlchemy Jun 30, 2025
25632ee
resolve merge conflict: remove test-report.json as part of cleanup
ScriptedAlchemy Jun 30, 2025
259aa69
resolve merge conflicts: keep our clean version without debug logging
ScriptedAlchemy Jun 30, 2025
3156e17
Merge branch 'treeshake-fix' of /Users/bytedance/RustroverProjects/rs…
ScriptedAlchemy Jun 30, 2025
cdbc52d
chore(wasm): enable wasm test ci (#10757)
CPunisher Jun 30, 2025
b0271bb
fix: restore empty files after merge conflicts and remove unused dire…
ScriptedAlchemy Jun 30, 2025
5f9c02d
fix: resolve clippy warnings and clean up codebase
ScriptedAlchemy Jun 30, 2025
00d551a
fix: restore comprehensive export analysis in ConsumeShared share usa…
ScriptedAlchemy Jun 30, 2025
7c36c91
fix: remove dead code and emojis from test files
ScriptedAlchemy Jun 30, 2025
99ec7b3
fix: remove dead code and emojis from test files
ScriptedAlchemy Jun 30, 2025
c5f5494
chore: clean up lock file and remove rustc ICE files
ScriptedAlchemy Jun 30, 2025
7f11573
fix: lint error when any package.json modified (#10846)
stormslowly Jul 1, 2025
1b25bd1
fix: fix_issuer mgm not found panic (#10845)
jerrykingxyz Jul 1, 2025
78b0622
fix(tracing): support call register & cleanup multi times (#10851)
hardfist Jul 1, 2025
f5464ef
fix: fix_issuer compatibility with incomplete module graph (#10852)
jerrykingxyz Jul 1, 2025
2e45f23
chore(ci): skip cross-env in webpack-test script (#10842)
stormslowly Jul 1, 2025
c758cf4
feat: implement tree-shaking for Module Federation ConsumeShared Comm…
ScriptedAlchemy Jul 1, 2025
6bffcfd
chore: temporary remove tracing js api test (#10858)
hardfist Jul 1, 2025
e9ab71e
Merge branch 'main' into treeshake-macro
ScriptedAlchemy Jul 1, 2025
b278aab
Merge branch 'treeshake-macro' into treeshake-fix
ScriptedAlchemy Jul 1, 2025
4486b96
fix: resolve JavaScript linting issues in test files
ScriptedAlchemy Jul 1, 2025
9cacb94
fix: remove extra ESM export specifier comments causing snapshot fail…
ScriptedAlchemy Jul 1, 2025
afbd4fe
chore: release 1.4.2 (#10850)
LingyuCoder Jul 1, 2025
fca90c5
fix: remove debug statements causing clippy warnings
ScriptedAlchemy Jul 1, 2025
fc9cb1e
fix(tracing): disable emit tracing event when call cleanup (#10859)
hardfist Jul 1, 2025
a7a7dab
fix: update tests to reflect correct tree-shaking behavior for CJS mo…
ScriptedAlchemy Jul 1, 2025
4f65bba
fix: remove unused rspack_plugin_javascript dependency from mf plugin
ScriptedAlchemy Jul 1, 2025
2e1edb9
fix: should union available modules when depend on multiple entry (#1…
JSerFeng Jul 1, 2025
99bc1d2
fix: try fix node.js 16 crash (#10861)
hardfist Jul 1, 2025
a59a4d9
fix(core): improve ignorePlugin error report (#10868)
hardfist Jul 2, 2025
2d7840c
ci: trigger new CI run after cargo-shear fix
ScriptedAlchemy Jul 2, 2025
e12b362
fix: remove needless borrow in parser plugin to resolve clippy warning
ScriptedAlchemy Jul 2, 2025
855e2af
fix: resolve clippy warnings in ConsumeSharedExportsDependency tests
ScriptedAlchemy Jul 2, 2025
96f74d1
feat(binding-builder): support using custom binding (#10857)
h-a-n-a Jul 2, 2025
4b1f656
refactor: remove export info map on module graph (#10849)
LingyuCoder Jul 2, 2025
1161892
feat: set module.ptr to None when cleanup the module (#10860)
SyMind Jul 2, 2025
537e8c5
fix: rspack error communicate between js and rust (#10595)
SyMind Jul 2, 2025
096a6f0
fix: disable PURE annotations for ConsumeShared detection
ScriptedAlchemy Jul 2, 2025
54c94f3
fix: completely disable PURE annotations for webpack require calls
ScriptedAlchemy Jul 2, 2025
384cc79
fix: improve PURE annotation logic for ConsumeShared modules
ScriptedAlchemy Jul 2, 2025
2ebf02a
chore(deps): update dependency zx to v8.6.1 (#10866)
renovate[bot] Jul 2, 2025
73be1ea
chore(deps): update github-actions (#10863)
renovate[bot] Jul 2, 2025
0733e4c
perf: use dashmap to reduce lock contention (#10878)
hardfist Jul 2, 2025
17a359e
refactor: use length as id instead of module id for lazy compilation …
JSerFeng Jul 2, 2025
0932978
chore(deps): update dependency @playwright/test to v1.53.2 (#10864)
renovate[bot] Jul 2, 2025
16556aa
fix: re-enable PURE annotations with improved ConsumeShared detection
ScriptedAlchemy Jul 2, 2025
e8cd2d2
fix: update hot test snapshots for improved PURE annotation detection
ScriptedAlchemy Jul 2, 2025
2466e4e
fix: enable PURE annotations for all modules with improved detection
ScriptedAlchemy Jul 2, 2025
be1618e
feat: update all rspack test snapshots for improved PURE annotation s…
ScriptedAlchemy Jul 2, 2025
5cb1eda
chore: enable on all
ScriptedAlchemy Jul 3, 2025
a3fb6e8
Squash merge treeshake-macro into treeshake-fix
ScriptedAlchemy Jul 3, 2025
ce6a6fd
chore: remove comments
ScriptedAlchemy Jul 3, 2025
d9f4919
Squash merge treeshake-macro into treeshake-fix (additional merge)
ScriptedAlchemy Jul 3, 2025
7f0e7cb
Resolve merge conflicts with main branch
ScriptedAlchemy Jul 3, 2025
f090388
Merge branch 'treeshake-macro' into treeshake-fix
ScriptedAlchemy Jul 3, 2025
49a5d90
chore: CI enable binary size limit (#10875)
stormslowly Jul 3, 2025
0cb5cc3
chore: Update browserslist-rs to 0.19 (#10872)
quininer Jul 3, 2025
8671bc1
fix: port public path of module chunk loading from webpack (#10425)
LingyuCoder Jul 3, 2025
07f6697
perf: remove visitor feature of lightningcss (#10884)
hardfist Jul 3, 2025
41f1148
perf: chunk js api (#10502)
SyMind Jul 3, 2025
15d1c9e
fix: restrict PURE annotations to actual ConsumeShared modules
ScriptedAlchemy Jul 3, 2025
ee213c5
chore: update test snapshots for corrected PURE annotation behavior
ScriptedAlchemy Jul 3, 2025
6ca42f0
chore: prepare for releasing crates (#10879)
h-a-n-a Jul 3, 2025
449f97b
fix: always rebuild error module (#10873)
jerrykingxyz Jul 3, 2025
7139853
fix: add error handling for invalid browserslist configuration (#10891)
chenjiahan Jul 3, 2025
85c23db
fix(wasm): use `parking_lot` nightly to avoid panic in tests (#10892)
h-a-n-a Jul 3, 2025
98b815e
perf: parallel create map assets (#10894)
LingyuCoder Jul 3, 2025
c24c686
feat: support base64 hash digest for css local ident name (#10897)
ahabhgk Jul 3, 2025
8a034f8
feat: render css runtime module with dojang (#10896)
GiveMe-A-Name Jul 3, 2025
b2b3d3f
fix: resolve Module Federation compilation errors
ScriptedAlchemy Jul 3, 2025
48a276e
chore: add debug_tool feature to improve debug dx (#10899)
hardfist Jul 3, 2025
4f4b0e3
feat(wasm): align panic handler with native (#10901)
CPunisher Jul 3, 2025
8e16e3c
chore: pretty return type error (#10886)
SyMind Jul 3, 2025
42f070c
fix: upgrade swc_core to 30.0.2 (#10895)
hardfist Jul 3, 2025
33732df
fix: break cycle for type reexports check (#10902)
ahabhgk Jul 3, 2025
b0069f1
refactor: remove js stats warning (#10900)
SyMind Jul 3, 2025
4e15f14
docs: expect CI runtime diff test failures - this is correct behavior
ScriptedAlchemy Jul 3, 2025
d537f34
docs: CI test failures are expected - rspack improvements over webpack
ScriptedAlchemy Jul 3, 2025
b58ebf2
fix: use hardcoded './' for import chunk loading to match webpack bas…
ScriptedAlchemy Jul 3, 2025
6036153
fix(runtime): prepend public path in module_chunk_loading_with_loadin…
ScriptedAlchemy Jul 3, 2025
ba464af
fix(runtime): revert module_chunk_loading_with_loading template to ma…
ScriptedAlchemy Jul 4, 2025
08abad5
fix(test): correct JSON escaping in runtime diff snapshot
ScriptedAlchemy Jul 4, 2025
aea4641
fix: allow the `module` property of WebpackError to be null (#10905)
SyMind Jul 4, 2025
123e4f5
perf: improve parallelism of real content hash plugin (#10888)
LingyuCoder Jul 4, 2025
8d8b1a0
fix(runtime): hardcode './' in module chunk loading template
ScriptedAlchemy Jul 4, 2025
a402397
fix(runtime): use PUBLIC_PATH in module chunk loading template
ScriptedAlchemy Jul 4, 2025
1f8587b
perf: parallelize getting full module names in the deterministic modu…
LingyuCoder Jul 4, 2025
a31aa40
chore: release v1.4.3 (#10904)
chenjiahan Jul 4, 2025
8b32606
chore: add release crates workflow (#10903)
h-a-n-a Jul 4, 2025
94ece6f
perf: cache ordered modules ids while sorting chunks (#10908)
LingyuCoder Jul 4, 2025
528c6e1
perf: parallelize getting source sizes in size limit plugin (#10910)
LingyuCoder Jul 4, 2025
748cdba
fix(runtime): revert dynamic import to use relative paths for Node.js…
ScriptedAlchemy Jul 4, 2025
4e2081b
fix: use bigger size limit for real content hash (#10907)
ahabhgk Jul 4, 2025
b57e1e5
perf: parallelize processing chunk hashes (#10912)
LingyuCoder Jul 4, 2025
c5528d9
fix: restore PUBLIC_PATH usage in module chunk loading template
ScriptedAlchemy Jul 4, 2025
a68bfa9
docs: upgrade Rspress-2.0.0-beta.19 (#10913)
SoonIter Jul 4, 2025
e06f7a8
fix(deps): update swc to 30.1.2 (#10916)
chenjiahan Jul 4, 2025
40c0daf
feat: pass WebpackError to ignoreWarnings (#10890)
SyMind Jul 5, 2025
6cddb40
chore: release v1.4.4 (#10917)
chenjiahan Jul 5, 2025
6c31981
chore: remove comments
ScriptedAlchemy Jul 6, 2025
1bc7764
🎉 Fix CJS tree-shaking macros for Module Federation
ScriptedAlchemy Jul 6, 2025
6b1f7a8
test: update CJS tree-shaking test expectations and consolidate test …
ScriptedAlchemy Jul 6, 2025
e06191e
fix: remove unused variable warning in ConsumeSharedExportsDependency
ScriptedAlchemy Jul 6, 2025
d8a2824
fix: apply clippy suggestion to use or instead of or_else
ScriptedAlchemy Jul 6, 2025
330b1ac
fix: correct tree-shaking macro format for CommonJS exports
ScriptedAlchemy Jul 6, 2025
d10b0b5
fix: revert PUBLIC_PATH change that broke container tests
ScriptedAlchemy Jul 6, 2025
2e05895
merge: resolve conflicts with main branch
ScriptedAlchemy Jul 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 20 additions & 0 deletions .github/actions/binary-limit/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Binary Size Limit

description: Compare binary size with default

inputs:
percentage-threshold:
description: "the"
default: "5"
required: false

runs:
using: composite

steps:
- name: GitHub Script
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
with:
script: |
const action = require("./.github/actions/binary-limit/binary-limit-script.js");
await action({github, context});
113 changes: 113 additions & 0 deletions .github/actions/binary-limit/binary-limit-script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
const fs = require("node:fs");

/**
* @param {import("@octokit/rest")} github
*/
module.exports = async function action({ github, context }) {
const commits = await github.rest.repos.listCommits({
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 30
});

let baseSize = 0;
let baseCommit = null;

for (const commit of commits.data) {
console.log(commit.sha);
try {
const data = await fetchDataBySha(commit.sha);
if (data?.size) {
baseCommit = commit;
baseSize = data.size;
console.log(`Commit ${commit.sha} has binary size: ${data.size}`);
break;
}
} catch (e) {
console.log(e);
}
}

if (!baseCommit) {
const error = `No base binary size found within ${commits.data.length} commits`;
console.log(error);
throw new Error(error);
}

const headSize = fs.statSync(
"./crates/node_binding/rspack.linux-x64-gnu.node"
).size;

const comment = compareBinarySize(headSize, baseSize, baseCommit);

await commentToPullRequest(github, context, comment);
};

async function commentToPullRequest(github, context, comment) {
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.number
});

const prevComment = comments.filter(
comment =>
comment.user.login === "github-actions[bot]" &&
comment.body.startsWith(SIZE_LIMIT_HEADING)
)[0];

if (prevComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: prevComment.id,
body: `${SIZE_LIMIT_HEADING}\n${comment}`
});
return;
}

await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.number,
body: `${SIZE_LIMIT_HEADING}\n${comment}`
});
}

function fetchDataBySha(sha) {
const dataUrl = `${DATA_URL_BASE}/commits/${sha.slice(0, 2)}/${sha.slice(2)}/rspack-build.json`;
console.log("fetching", dataUrl, "...");
return fetch(dataUrl).then(res => res.json());
}

const SIZE_LIMIT_HEADING = "## 📦 Binary Size-limit";

const DATA_URL_BASE =
"https://raw.githubusercontent.com/web-infra-dev/rspack-ecosystem-benchmark/data";

function compareBinarySize(headSize, baseSize, baseCommit) {
const message = baseCommit.commit.message.split("\n")[0];
const author = baseCommit.commit.author.name;

const info = `> Comparing binary size with Commit: [${message} by ${author}](${baseCommit.html_url})\n\n`;

const diff = headSize - baseSize;
const percentage = (Math.abs(diff / baseSize) * 100).toFixed(2);
if (diff > 0) {
return `${info}❌ Size increased by ${toHumanReadable(diff)} from ${toHumanReadable(baseSize)} to ${toHumanReadable(headSize)} (⬆️${percentage}%)`;
}
if (diff < 0) {
return `${info}🎉 Size decreased by ${toHumanReadable(-diff)} from ${toHumanReadable(baseSize)} to ${toHumanReadable(headSize)} (⬇️${percentage}%)`;
}
return `${info}🙈 Size remains the same at ${toHumanReadable(headSize)}`;
}

function toHumanReadable(size) {
if (size < 1024) {
return `${size}bytes`;
}
if (size < 1024 * 1024) {
return `${(size / 1024).toFixed(2)}KB`;
}
return `${(size / 1024 / 1024).toFixed(2)}MB`;
}
117 changes: 7 additions & 110 deletions .github/workflows/ci-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,112 +18,9 @@ on:
tags-ignore:
- "**"
jobs:
check-changed:
runs-on: ubuntu-latest
name: Check Source Changed
outputs:
code_changed: ${{ steps.filter.outputs.code_changed == 'true' }}
document_changed: ${{ steps.filter.outputs.document_changed == 'true' }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
id: filter
with:
predicate-quantifier: "every"
filters: |
code_changed:
- "!**/*.md"
- "!**/*.mdx"
- "!website/**"
document_changed:
- "website/**"
rust_check:
name: Rust check
needs: [check-changed]
if: ${{ needs.check-changed.outputs.code_changed == 'true' }}
runs-on: ${{ fromJSON(vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"') }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Install Rust Toolchain
uses: ./.github/actions/rustup
with:
save-if: true
key: check

- name: Run Cargo Check
run: cargo check --workspace --all-targets --locked # Not using --release because it uses too much cache, and is also slow.

- name: Run Clippy
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1
with:
command: clippy
args: --workspace --all-targets --tests -- -D warnings

- name: Run rustfmt
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1
with:
command: fmt
args: --all -- --check

- name: Install tapo
run: cargo install taplo-cli --locked
- name: Run toml format check
run: taplo format --check '.cargo/*.toml' './crates/**/Cargo.toml' './Cargo.toml'

rust_unused_dependencies:
needs: [check-changed]
if: ${{ needs.check-changed.outputs.code_changed == 'true' }}
name: Check Rust Dependencies
runs-on: ${{ fromJSON(vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"') }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: ./.github/actions/rustup
with:
key: check

- name: Install cargo-deny
uses: taiki-e/install-action@726a5c9e4be3a589bab5f60185f0cdde7ed4498e # v2
with:
tool: [email protected]
- name: Check licenses
run: cargo deny check license bans

- uses: cargo-bins/cargo-binstall@8aac5aa2bf0dfaa2863eccad9f43c68fe40e5ec8 # v1.14.1
- run: cargo binstall --no-confirm [email protected] --force
- run: cargo shear

rust_test:
name: Rust test
runs-on: ${{ fromJSON(vars.LINUX_SELF_HOSTED_RUNNER_LABELS || '"ubuntu-22.04"') }}
needs: [check-changed]
if: ${{ needs.check-changed.outputs.code_changed == 'true' }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Install Rust Toolchain
uses: ./.github/actions/rustup
with:
save-if: true
key: test

# Compile test without debug info for reducing the CI cache size
- name: Change profile.test
shell: bash
run: |
echo '[profile.test]' >> Cargo.toml
echo 'debug = false' >> Cargo.toml
- name: Run rspack test
run: |
cargo test --workspace \
--exclude rspack_binding_api \
--exclude rspack_node \
--exclude rspack_binding_builder \
--exclude rspack_binding_builder_macros \
--exclude rspack_binding_builder_testing \
--exclude rspack_binding_build \
--exclude rspack_napi \
-- --nocapture
rust_tests:
name: Run Rust Tests
uses: ./.github/workflows/reusable-rust-test.yml

rust_test_miri:
name: Rust test miri
Expand Down Expand Up @@ -158,14 +55,14 @@ jobs:
# When code changed, it will check if any of the test jobs failed.
# When *only* doc changed, it will run as success directly
name: Rust Test Required Check
needs: [rust_test, rust_check, check-changed]
needs: [rust_tests]
if: ${{ always() && !cancelled() }}
runs-on: ubuntu-latest
steps:
- name: Log
run: echo ${{ join(needs.*.result, ',') }}
run: echo ${{ needs.*.result }}
- name: Test check
if: ${{ needs.check-changed.outputs.code_changed == 'true' && join(needs.*.result, ',')!='success,success,success' }}
run: echo "Tess Failed" && exit 1
if: ${{ needs.rust_tests.result != 'success' }}
run: echo "Tests Failed" && exit 1
- name: No check to Run test
run: echo "Success"
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ concurrency:
permissions:
# Allow commenting on issues for `reusable-build.yml`
issues: write
# Allow commenting on pull requests for `size-limit.yml`
pull-requests: write

jobs:
check-changed:
Expand Down Expand Up @@ -138,6 +140,12 @@ jobs:
- name: No check to Run test
run: echo "Success"

size-limit:
name: Binary Size Limit
needs: [check-changed]
if: ${{ needs.check-changed.outputs.code_changed == 'true' && github.event_name == 'pull_request' }}
uses: ./.github/workflows/size-limit.yml

# TODO: enable it after self hosted runners are ready
# pkg-preview:
# name: Pkg Preview
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/release-crates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Release Crates

on:
workflow_dispatch:
inputs:
dry_run:
type: boolean
description: "DryRun release"
required: true
default: false
push_tags:
type: boolean
description: "Push tags to repository"
required: true
default: true

jobs:
rust_tests:
name: Run Rust Tests
uses: ./.github/workflows/reusable-rust-test.yml

release_crates:
environment: crate
name: Release Crates
runs-on: ubuntu-latest
needs: [rust_tests]
if: ${{ github.event_name == 'workflow_dispatch' }}
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0

- name: Install Rust Toolchain
uses: ./.github/actions/rustup
with:
save-if: true
key: release

- name: Install cargo-workspaces
run: cargo install cargo-workspaces --locked

- name: Publish Crates
run: |
./x crate-publish --token $CARGO_REGISTRY_TOKEN ${{ inputs.dry_run && '--dry-run' || '' }} ${{ inputs.push_tags && '--push-tags' || '' }}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
Loading
Loading