-
Notifications
You must be signed in to change notification settings - Fork 12
64 lines (57 loc) · 2.03 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
62
63
64
---
name: Release
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
jobs:
build-release:
name: build-release
runs-on: ubuntu-latest
env:
RUST_BACKTRACE: 1
steps:
- name: Checkout repository
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
with:
fetch-tags: false # https://github.com/actions/checkout/issues/1467
- run: git fetch --tags
name: Fetch tags manually as a workaround. See https://github.com/actions/checkout/issues/1467
- name: Install Rust
uses: dtolnay/rust-toolchain@d388a4836fcdbde0e50e395dc79a2670ccdef13f # stable
with:
toolchain: '1.76.0'
profile: minimal
override: true
target: wasm32-wasi
- name: Build release binary
run: cargo build --release
- name: Generate a changelog
uses: orhun/git-cliff-action@5594a53dc7c8647d85bd3d4da4ca78d3aa3dca4c # v3
id: git-cliff
with:
config: cliff.toml
args: -vv --latest --strip header
env:
OUTPUT: CHANGES.md
- name: Create release
id: create_release
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event_name == 'workflow_dispatch' && '' || github.ref }}
release_name: Release ${{ github.event_name == 'workflow_dispatch' && 'main' || github.ref }}
draft: true
body: ${{ steps.git-cliff.outputs.content }}
prerelease: false
- name: Upload wasm file to release
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/wasm32-wasi/release/zjstatus.wasm
asset_name: zjstatus.wasm
asset_content_type: application/octet-stream