Skip to content
This repository was archived by the owner on Sep 17, 2023. It is now read-only.

Commit da33170

Browse files
committed
ci: create github release with assets
1 parent 49d60c7 commit da33170

File tree

4 files changed

+11151
-0
lines changed

4 files changed

+11151
-0
lines changed

.github/workflows/release.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
name: Release
3+
4+
on:
5+
push:
6+
branches: [ master, alpha, beta ]
7+
8+
jobs:
9+
build-linux-gnu:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Install GNU/Linux toolchain
16+
uses: actions-rs/toolchain@v1
17+
with:
18+
profile: minimal
19+
toolchain: stable
20+
target: x86_64-unknown-linux-gnu
21+
22+
- name: Build GNU/Linux
23+
uses: actions-rs/cargo@v1
24+
with:
25+
command: build
26+
args: --release --target x86_64-unknown-linux-gnu
27+
28+
- name: Prepare GNU/Linux artifacts
29+
run: |
30+
mkdir -p dist builds/typescript-tools-linux
31+
cp target/x86_64-unknown-linux-gnu/release/rust_typescript_tools builds/typescript-tools-linux-gnu
32+
tar -C builds -czvf dist/typescript-tools-linux-gnu.tar.gz typescript-tools-linux-gnu
33+
34+
- name: Upload GNU/Linux artifact
35+
uses: actions/upload-artifact@v2
36+
with:
37+
name: x86_64-unknown-linux-gnu
38+
path: dist/typescript-tools-linux-gnu.tar.gz
39+
40+
build-darwin:
41+
runs-on: macos-11
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v2
45+
46+
- name: Install Mac OS toolchain
47+
uses: actions-rs/toolchain@v1
48+
with:
49+
profile: minimal
50+
toolchain: stable
51+
target: x86_64-apple-darwin
52+
53+
- name: Build Mac OS
54+
uses: actions-rs/cargo@v1
55+
with:
56+
command: build
57+
args: --release --target x86_64-apple-darwin
58+
59+
- name: Prepare Mac OS artifacts
60+
run: |
61+
mkdir -p dist builds/typescript-tools-apple-darwin
62+
cp target/x86_64-apple-darwin/release/rust_typescript_tools builds/typescript-tools-apple-darwin
63+
tar -C builds -czvf dist/typescript-tools-apple-darwin.tar.gz typescript-tools-apple-darwin
64+
65+
- name: Upload Mac OS artifact
66+
uses: actions/upload-artifact@v2
67+
with:
68+
name: x86_64-apple-darwin
69+
path: dist/typescript-tools-apple-darwin.tar.gz
70+
71+
release:
72+
needs: [ build-linux-gnu, build-darwin ]
73+
runs-on: ubuntu-latest
74+
steps:
75+
- name: Checkout
76+
uses: actions/checkout@v2
77+
78+
- name: Download GNU/Linux artifact
79+
uses: actions/download-artifact@v2
80+
with:
81+
name: x86_64-unknown-linux-gnu
82+
path: dist/typescript-tools-linux-gnu.tar.gz
83+
84+
- name: Download Mac OS artifact
85+
uses: actions/download-artifact@v2
86+
with:
87+
name: x86_64-apple-darwin
88+
path: dist/typescript-tools-apple-darwin.tar.gz
89+
90+
- name: Install release dependencies
91+
env:
92+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
93+
run: |
94+
npm install
95+
npx semantic-release
96+

.releaserc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"branches": [
3+
"master",
4+
"alpha",
5+
"beta"
6+
],
7+
"plugins": [
8+
"@semantic-release/commit-analyzer",
9+
"@semantic-release/release-notes-generator",
10+
[
11+
"@semantic-release/github",
12+
{
13+
"assets": [
14+
{
15+
"path": "dist/typescript-tools-linux-gnu.tar.gz",
16+
"label": "x86_64-unknown-linux-gnu"
17+
},
18+
{
19+
"path": "dist/typescript-tools-apple-darwin.tar.gz",
20+
"label": "x86_64-apple-darwin"
21+
}
22+
]
23+
}
24+
]
25+
]
26+
}

0 commit comments

Comments
 (0)