-
Notifications
You must be signed in to change notification settings - Fork 0
189 lines (152 loc) · 4.98 KB
/
publish.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: Build & Publish
permissions: write-all
on:
push:
schedule:
- cron: "0 0 1 * *"
jobs:
publish_cargo:
name: Publish to cargo
continue-on-error: true
runs-on: ubuntu-latest
steps:
- name: Initial Commit
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
- name: Add Version Info
run: node ver.js
env:
NIGHTLY: ${{ github.event_name == 'push' }}
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
- name: Publish
run: |
cd interpreter
cargo publish --allow-dirty || true
cd ../macros
cargo publish --allow-dirty || true
continue-on-error: true
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
- name: Commit Suffix
uses: EndBug/add-and-commit@v9
with:
add: suffix
author_name: GitHub Actions
author_email: [email protected]
message: Consume suffix file
build:
name: Release & Publish
continue-on-error: true
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-msvc
runner: windows-latest
- target: aarch64-pc-windows-msvc
runner: windows-latest
- target: x86_64-unknown-linux-gnu
runner: ubuntu-22.04
- target: aarch64-unknown-linux-gnu
runner: ubuntu-22.04
- target: x86_64-apple-darwin
runner: macos-latest
- target: aarch64-apple-darwin
runner: macos-latest
runs-on: ${{ matrix.runner }}
steps:
- name: Initial Commit
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
- name: Setup pnpm
run: npm i -g pnpm
- name: Add Version Info
run: node ver.js
env:
NIGHTLY: ${{ github.event_name == 'push' }}
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
target: ${{ matrix.target }}
- name: Install Deps (Linux aarch64)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt update
sudo apt install gcc-aarch64-linux-gnu
sudo dpkg --add-architecture arm64
sudo cat ubuntu | sudo tee /etc/apt/sources.list
sudo apt-get update && sudo apt-get upgrade -y
sudo apt install build-essential \
curl \
wget \
file \
libxdo-dev:arm64 \
libayatana-appindicator3-dev:arm64 \
librsvg2-dev:arm64 \
libgtk-3-dev:arm64
sudo apt install libwebkit2gtk-4.1-dev:arm64
sudo apt install libssl-dev:arm64
sudo apt install zip
- name: Install Deps (Linux x86)
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: |
sudo apt update
sudo apt install zip
sudo apt install libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libgtk-3-dev
- name: Build Lead Docs UI
run: pnpm install; pnpm build
working-directory: lead_docs/ui
- name: Package stuff
run: cargo +nightly run --release
env:
TARGET: ${{ matrix.target }}
- name: Build Leadman
run: cargo +nightly build --target ${{ matrix.target }} --release
working-directory: leadman
- name: chmod
if: runner.os == 'Linux'
run: chmod 777 ./publish
- name: Get tag
run: ./publish
id: tag
- name: Publish Linux / Macos Bin
uses: svenstaro/upload-release-action@v2
if: matrix.runner != 'windows-latest'
with:
file: ./leadman/target/${{ matrix.target }}/release/leadman
asset_name: leadman_${{ matrix.target }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.tag.outputs.TAG_NAME }}
prerelease: ${{ github.event_name == 'push' }}
- name: Publish Windows Bin
uses: svenstaro/upload-release-action@v2
if: matrix.runner == 'windows-latest'
with:
file: ./leadman/target/${{ matrix.target }}/release/leadman.exe
asset_name: leadman_${{ matrix.target }}.exe
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.tag.outputs.TAG_NAME }}
prerelease: ${{ github.event_name == 'push' }}
- name: Publish
uses: svenstaro/upload-release-action@v2
with:
file: ./build.zip
asset_name: binaries_${{ matrix.target }}.zip
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.tag.outputs.TAG_NAME }}
prerelease: ${{ github.event_name == 'push' }}