-
Notifications
You must be signed in to change notification settings - Fork 91
/
Copy pathaction.yml
62 lines (53 loc) · 1.9 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: 'bump-versions'
description: 'Bump project versions for the release target'
inputs:
release-target:
description: "target of the release (rust|wasm)"
required: true
version:
description: "version to set (e.g. `1.2.3` or `1.2.3-dev.1`)"
required: true
runs:
using: "composite"
steps:
- name: Setup Rust
uses: './.github/actions/rust/rust-setup'
with:
os: ${{ runner.os }}
job: ${{ github.job }}
- name: Install cargo-workspaces
shell: bash
run: cargo install --version ^0.2 cargo-workspaces
- name: Install cargo-edit # to use cargo add and set-version
shell: bash
run: cargo install -f --no-default-features --features "set-version" --version ^0.8 cargo-edit
- name: Bump Rust crate versions
shell: bash
if: ${{inputs.release-target == 'rust'}}
run: |
cargo workspaces version --force "*" --no-git-commit --exact custom ${{ inputs.version }} -y
# cargo workspaces ignores examples/ but cargo release still tries to version it during publishing.
- name: Bump Rust examples version
shell: bash
if: ${{inputs.release-target == 'rust'}}
working-directory: examples
run: |
cargo set-version ${{ inputs.version }}
- name: Bump Wasm bindings crate version
shell: bash
if: ${{inputs.release-target == 'wasm'}}
working-directory: bindings/wasm
run: |
cargo workspaces version --force "*" --no-git-commit --exact custom ${{ inputs.version }} -y -a
- name: Set up Node.js
uses: actions/setup-node@v2
if: ${{inputs.release-target == 'wasm'}}
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Bump Wasm npm package version
shell: bash
if: ${{inputs.release-target == 'wasm'}}
working-directory: bindings/wasm
run: |
npm version ${{ inputs.version }}