-
-
Notifications
You must be signed in to change notification settings - Fork 289
151 lines (147 loc) · 4.36 KB
/
build.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
name: Build
on:
push:
branches: [ '*' ]
tags:
- v*
pull_request:
branches: [ master ]
jobs:
build-docker:
runs-on: ubuntu-latest
container: docker://hhmhh/weylus_build:latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: deps/dist*
key: ${{ runner.os }}-deps-${{ hashFiles('deps/*') }}
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: Build
run: ./docker_build.sh
shell: bash
- name: Artifacts1
uses: actions/upload-artifact@v4
with:
name: linux
path: packages/weylus-linux.zip
- name: Artifacts2
uses: actions/upload-artifact@v4
with:
name: linux-deb
path: packages/Weylus*.deb
- name: Artifacts3
uses: actions/upload-artifact@v4
with:
name: windows
path: packages/weylus-windows.zip
- name: Publish
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
packages/weylus-linux.zip
packages/Weylus*.deb
packages/weylus-windows.zip
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-docker-alpine:
runs-on: ubuntu-latest
container: docker://hhmhh/weylus_build_alpine:latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: deps/dist*
key: ${{ runner.os }}-alpine-deps-${{ hashFiles('deps/*') }}
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-alpine-cargo-${{ hashFiles('Cargo.lock') }}
- name: Build
run: RUSTFLAGS='-C target-feature=-crt-static' cargo build --release && cd target/release && tar czf weylus-linux-alpine-musl.tar.gz weylus
shell: bash
- name: Artifacts1
uses: actions/upload-artifact@v4
with:
name: linux-alpine-musl
path: target/release/weylus-linux-alpine-musl.tar.gz
- name: Publish
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/release/weylus-linux-alpine-musl.tar.gz
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-macos:
strategy:
matrix:
os: [macos-latest, macos-13] # -latest if for Apple Silicon, -13 is for Intel
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: deps/dist
key: ${{ runner.os }}-deps-${{ hashFiles('deps/*') }}
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: Download deps
run: |
npm install -g typescript
brew install nasm
cargo install cargo-bundle
shell: bash
- name: Build
# run: MACOSX_DEPLOYMENT_TARGET=10.13 cargo bundle --release
run: cargo bundle --release
- name: Package
run: |
MACOS_BUILD_NAME=macos-$([ "${{ matrix.os }}" == "macos-latest" ] && echo "arm" || echo "intel")
echo "MACOS_BUILD_NAME=$MACOS_BUILD_NAME" >> $GITHUB_ENV
cd target/release/bundle/osx/ && zip -r ${MACOS_BUILD_NAME}.zip Weylus.app
- name: Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.MACOS_BUILD_NAME }}
path: target/release/bundle/osx/${{ env.MACOS_BUILD_NAME }}.zip
- name: ArtifactsDebug
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-ffbuild
path: |
deps/ffmpeg/ffbuild
- name: Debug via SSH
if: failure()
uses: luchihoratiu/debug-via-ssh@main
with:
NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
SSH_PASS: ${{ secrets.SSH_PASS }}
NGROK_REGION: eu
- name: Publish
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/release/bundle/osx/macOS.zip
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}