Skip to content

Commit a1b957f

Browse files
committed
ci(release): add workflow to publish crate when tagging (#22)
1 parent f79da6e commit a1b957f

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

.github/workflows/release.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Release stable version
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
publish-stable:
10+
name: Create a stable release
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- name: Checkout Repo
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Generate a changelog
21+
uses: orhun/git-cliff-action@v4
22+
with:
23+
config: cliff.toml
24+
args: --latest --strip header
25+
env:
26+
OUTPUT: BODY.md
27+
28+
- name: Publish on GitHub
29+
uses: ncipollo/release-action@v1
30+
with:
31+
prerelease: false
32+
bodyFile: BODY.md
33+
34+
publish-crate:
35+
name: Publish crate
36+
runs-on: ubuntu-latest
37+
env:
38+
LLVM_INSTALL_PATH: ~/llvm
39+
LLVM_VERSION: "14"
40+
LLVM_LIB_NAME: "libLLVM-14.so"
41+
steps:
42+
- name: Checkout the repository
43+
uses: actions/checkout@v4
44+
45+
- name: Setup LLVM Installation Path
46+
run: |
47+
mkdir ${{ env.LLVM_INSTALL_PATH }}
48+
echo "$HOME/llvm/bin" >> $GITHUB_PATH
49+
50+
- name: Check LLVM Artifacts In Cache
51+
id: cache-llvm
52+
uses: actions/cache@v3
53+
with:
54+
path: |
55+
${{ env.LLVM_INSTALL_PATH }}/bin/llvm-config
56+
${{ env.LLVM_INSTALL_PATH }}/bin/opt
57+
${{ env.LLVM_INSTALL_PATH }}/lib/${{ env.LLVM_LIB_NAME }}
58+
${{ env.LLVM_INSTALL_PATH }}/lib/libLLVM.so
59+
${{ env.LLVM_INSTALL_PATH }}/include
60+
key: ${{ runner.os }}-llvm-${{ env.LLVM_VERSION }}-opt
61+
62+
- name: Install cargo-release
63+
uses: taiki-e/install-action@v1
64+
with:
65+
tool: cargo-release
66+
67+
- name: Publish
68+
run: cargo release publish -x --no-confirm --workspace --features llvm-plugin/llvm${{ env.LLVM_VERSION }}-0
69+
env:
70+
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}

0 commit comments

Comments
 (0)