-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (57 loc) · 1.74 KB
/
release.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
name: Release ic-websocket-cdk-rs
# only run when the tests complete
on:
workflow_run:
workflows: [ic-websocket-cdk-rs tests]
types:
- completed
branches:
- main
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
# only run if the tests were successful or the workflow was dispatched manually
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
outputs:
version: ${{ steps.cargo-publish.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: "stable"
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "true"
- name: Publish on crates.io
id: cargo-publish
run: |
rustup target add wasm32-unknown-unknown
cargo publish -p ic-websocket-cdk
echo "version=$(cargo pkgid -p ic-websocket-cdk | cut -d# -f2 | cut -d: -f2)" >> "$GITHUB_OUTPUT"
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
tag:
needs: publish
runs-on: ubuntu-latest
outputs:
version: ${{ steps.tag_version.outputs.new_tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ needs.publish.outputs.version }}
release:
needs: tag
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.tag.outputs.version }}