-
Notifications
You must be signed in to change notification settings - Fork 52
50 lines (43 loc) · 1.52 KB
/
cd-rust.yaml
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
name: CD-Rust
on:
# When Pull Request is merged
pull_request_target:
types: [closed]
jobs:
Publish-Crates-IO:
name: Publish rust crates to crates.io
if: |
github.event.pull_request.user.login == 'polywrap-build-bot' &&
github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.base.ref }}
- name: Read VERSION into env.RELEASE_VERSION
run: echo RELEASE_VERSION=$(cat VERSION) >> $GITHUB_ENV
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Build RS crates
working-directory: ./packages/wasm/rs
run: cargo build --release
- name: Verify & Generate RS Documentation
working-directory: ./packages/wasm/rs
run: cargo doc --no-deps
- name: Upload Rust Crates To Crates.io
working-directory: ./packages/wasm/rs
run: cargo publish --token ${{secrets.POLYWRAP_BUILD_BOT_CRATES_PAT}}
- uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '**[Crates.io Release Published](https://crates.io/search?q=polywrap) `${{env.RELEASE_VERSION}}`** 🎉'
})