-
Notifications
You must be signed in to change notification settings - Fork 2
85 lines (70 loc) · 2.68 KB
/
release.yml
File metadata and controls
85 lines (70 loc) · 2.68 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Release
on:
workflow_dispatch:
inputs:
bump:
description: 'Bump version by semver keyword.'
required: true
type: choice
options:
- patch
- minor
- major
permissions:
contents: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App token
id: app-token
uses: getsentry/action-github-app-token@v3
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v6
- name: Set up Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: wasm32-unknown-unknown
- name: Install Cargo Binary Install
uses: cargo-bins/cargo-binstall@main
- name: Install crates
run: cargo binstall --force -y cargo-workspaces toml-cli
- name: Bump version
run: cargo workspaces version --all --no-git-commit --yes ${{ inputs.bump }}
- name: Extract version
id: extract-version
run: echo "VERSION=v$(toml get Cargo.toml workspace.package.version --raw)" >> "$GITHUB_OUTPUT"
- name: Add changes
run: git add .
- name: Commit
id: commit
uses: dsanders11/github-app-commit-action@v2
with:
message: ${{ steps.extract-version.outputs.VERSION }}
token: ${{ steps.app-token.outputs.token }}
- name: Reset and pull
run: git reset --hard && git pull
- name: Tag
uses: actions/github-script@v8
env:
GIT_TAG: ${{ steps.extract-version.outputs.VERSION }}
GIT_SHA: ${{ steps.commit.outputs.sha }}
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${process.env.GIT_TAG}`,
sha: process.env.GIT_SHA
})
- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
make_latest: true
tag_name: ${{ steps.extract-version.outputs.VERSION }}
token: ${{ steps.app-token.outputs.token }}