@@ -18,159 +18,6 @@ permissions:
1818jobs :
1919 release :
2020 name : Release
21- runs-on : ubuntu-latest
22-
23- outputs :
24- version : ${{ steps.extract-version.outputs.VERSION }}
25-
26- steps :
27- - name : Generate GitHub App token
28- id : app-token
29- uses : getsentry/action-github-app-token@v3
30- with :
31- app_id : ${{ secrets.APP_ID }}
32- private_key : ${{ secrets.APP_PRIVATE_KEY }}
33-
34- - name : Checkout
35- uses : actions/checkout@v6
36-
37- - name : Set up Rust toolchain
38- uses : actions-rust-lang/setup-rust-toolchain@v1
39- with :
40- target : wasm32-unknown-unknown
41-
42- - name : Install Cargo Binary Install
43- uses : cargo-bins/cargo-binstall@main
44-
45- - name : Install crates
46- run : cargo binstall --force -y cargo-workspaces toml-cli
47-
48- - name : Bump version
49- run : cargo workspaces version --all --no-git-commit --yes ${{ inputs.bump }}
50-
51- - name : Extract version
52- id : extract-version
53- run : echo "VERSION=v$(toml get Cargo.toml workspace.package.version --raw)" >> "$GITHUB_OUTPUT"
54-
55- - name : Add changes
56- run : git add .
57-
58- - name : Commit
59- uses : dsanders11/github-app-commit-action@v2
60- with :
61- message : ${{ steps.extract-version.outputs.VERSION }}
62- token : ${{ steps.app-token.outputs.token }}
63-
64- - name : Reset and pull
65- run : git reset --hard && git pull
66-
67- - name : Tag
68- uses : bruno-fs/repo-tagger@1.0.0
69- with :
70- tag : ${{ steps.extract-version.outputs.VERSION }}
71- env :
72- GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
73-
74- - name : Release
75- uses : softprops/action-gh-release@v3
76- with :
77- generate_release_notes : true
78- make_latest : true
79- tag_name : ${{ steps.extract-version.outputs.VERSION }}
80- token : ${{ steps.app-token.outputs.token }}
81-
82- - name : Publish
83- run : cargo workspaces publish --publish-as-is --token "${{ secrets.CRATES_IO_TOKEN }}"
84-
85- release-binary :
86- strategy :
87- fail-fast : false
88- matrix :
89- package : [mdbook-tabs, mdbook-trunk]
90- target :
91- [
92- aarch64-unknown-linux-gnu,
93- aarch64-unknown-linux-musl,
94- x86_64-unknown-linux-gnu,
95- x86_64-unknown-linux-musl,
96- aarch64-apple-darwin,
97- x86_64-apple-darwin,
98- x86_64-pc-windows-msvc,
99- ]
100- include :
101- - target : aarch64-unknown-linux-gnu
102- os : ubuntu-latest
103- - target : aarch64-unknown-linux-musl
104- os : ubuntu-latest
105- - target : x86_64-unknown-linux-gnu
106- os : ubuntu-latest
107- - target : x86_64-unknown-linux-musl
108- os : ubuntu-latest
109- - target : aarch64-apple-darwin
110- os : macos-latest
111- - target : x86_64-apple-darwin
112- os : macos-latest
113- - target : x86_64-pc-windows-msvc
114- os : windows-latest
115-
116- runs-on : ${{ matrix.os }}
117- name : Release ${{ matrix.package }} for ${{ matrix.target }}
118- needs : release
119-
120- steps :
121- - uses : actions/checkout@v6
122-
123- - name : Set up Rust toolchain
124- uses : actions-rust-lang/setup-rust-toolchain@v1
125- with :
126- components : clippy, llvm-tools-preview, rustfmt, rust-std
127- target : ${{ matrix.target }}
128-
129- - name : Set up target (*-musl)
130- if : ${{ endsWith(matrix.target, '-musl') }}
131- run : |
132- sudo apt update -y
133- sudo apt install -y musl-dev musl-tools
134-
135- - name : Set up target (aarch64-unknown-linux-gnu)
136- if : ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
137- run : |
138- sudo apt update -y
139- sudo apt install -y gcc-aarch64-linux-gnu
140- echo CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc >> $GITHUB_ENV
141-
142- - name : Set up target (aarch64-unknown-linux-musl)
143- if : ${{ matrix.target == 'aarch64-unknown-linux-musl' }}
144- run : |
145- sudo apt update -y
146- sudo apt install -y clang llvm musl-dev musl-tools
147- echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS=-Clink-self-contained=yes -Clinker=rust-lld" >> $GITHUB_ENV
148- echo CC_aarch64_unknown_linux_musl=clang >> $GITHUB_ENV
149- echo AR_aarch64_unknown_linux_musl=llvm-ar >> $GITHUB_ENV
150-
151- - name : Build
152- run : cargo build --bins --locked --release --target ${{ matrix.target }}
153-
154- - name : Archive (tar.gz)
155- if : ${{ !contains(matrix.target, '-windows-') }}
156- run : tar czf ../../${{ matrix.package }}-${{ needs.release.outputs.version }}-${{ matrix.target }}.tar.gz ${{ matrix.package }}
157- working-directory : target/${{ matrix.target }}/release
158-
159- - name : Archive (zip)
160- if : ${{ contains(matrix.target, '-windows-') }}
161- run : 7z a ../../${{ matrix.package }}-${{ needs.release.outputs.version }}-${{ matrix.target }}.zip ${{ matrix.package }}.exe
162- working-directory : target/${{ matrix.target }}/release
163-
164- - name : Upload release asset (tar.gz)
165- if : ${{ !contains(matrix.target, '-windows-') }}
166- uses : softprops/action-gh-release@v3
167- with :
168- tag_name : ${{ needs.release.outputs.version }}
169- files : target/${{ matrix.package }}-${{ needs.release.outputs.version }}-${{ matrix.target }}.tar.gz
170-
171- - name : Upload release asset (zip)
172- if : ${{ contains(matrix.target, '-windows-') }}
173- uses : softprops/action-gh-release@v3
174- with :
175- tag_name : ${{ needs.release.outputs.version }}
176- files : target/${{ matrix.package }}-${{ needs.release.outputs.version }}-${{ matrix.target }}.zip
21+ uses : RustForWeb/.github/.github/workflows/release.yml@373c25f8fd29e10c40f1343f13312f8be3514af0
22+ with :
23+ bump : ${{ inputs.bump }}
0 commit comments