-
Notifications
You must be signed in to change notification settings - Fork 1
149 lines (131 loc) · 3.95 KB
/
gh-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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Github Release
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
branches:
- "main"
push:
branches:
- "main"
jobs:
# test_unit_js:
# name: 🧪 Unit Tests JavaScript
# runs-on: ubuntu-24.04
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# - uses: ./.github/actions/rust-toolchain
# - uses: Swatinem/rust-cache@v2
# with: { shared-key: "${{ runner.os }}" }
# - run: yarn
# - run: yarn build-native-release && yarn build
# - run: yarn test:js:unit
# test_unit_rs:
# name: 🧪 Unit Tests Rust
# runs-on: ubuntu-24.04
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# - uses: ./.github/actions/rust-toolchain
# - uses: Swatinem/rust-cache@v2
# with: { shared-key: "${{ runner.os }}" }
# - run: yarn
# - run: yarn build-native-release && yarn build
# - run: yarn test:rs:unit
# test_integration:
# name: 🧪 Integration Tests
# runs-on: ubuntu-24.04
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# - uses: ./.github/actions/rust-toolchain
# - uses: Swatinem/rust-cache@v2
# with: { shared-key: "${{ runner.os }}" }
# - run: yarn
# - run: yarn build-native-release && yarn build
# - run: yarn test:integration
# lint_and_format:
# name: 📝 Lint & Format
# runs-on: ubuntu-24.04
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v4
# - uses: ./.github/actions/rust-toolchain
# with: { components: "clippy, rustfmt" }
# - uses: Swatinem/rust-cache@v2
# with: { shared-key: "${{ runner.os }}" }
# - run: yarn --frozen-lockfile
# - run: yarn build-native-release && yarn build
# - run: yarn lint
build_native:
strategy:
matrix:
config:
- name: 🐥 Linux AMD64
os: linux
arch: amd64
runner: ubuntu-24.04
- name: 🐥 Linux ARM64
os: linux
arch: arm64
runner: ubuntu-24.04-arm
- name: 🍎 MacOS AMD64
os: macos
arch: amd64
runner: macos-13
- name: 🍎 MacOS ARM64
os: macos
arch: arm64
runner: macos-15
# - name: 🟦 Windows AMD64
# os: windows
# arch: amd64
# runner: windows-latest
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.runner }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: ./.github/actions/rust-toolchain
- run: yarn --frozen-lockfile
- run: yarn build-native-release
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.os }}-${{ matrix.config.arch }}
path: ${{ github.workspace }}/packages/core/rust/*.node
if-no-files-found: error
retention-days: 1
build_flow:
name: 🔨 Build Flow
runs-on: ubuntu-24.04
needs: ["build_native"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/download-artifact@v4
with: { path: "${{ github.workspace }}/packages/core/rust" }
- run: yarn --frozen-lockfile
- run: yarn build
- run: yarn build-ts
publish-github-release:
name: "🔄 Publish Github Release"
runs-on: ubuntu-24.04
needs:
# - test_unit_js
# - test_unit_rs
# - test_integration
# - lint_and_format
- build_flow
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with: { path: artifacts }
- name: Publish` Github Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
TAG="$(date -u +"v%Y.%m.%d.%H%M").${GITHUB_SHA::4}"
echo "Tag: ${TAG}"