-
Notifications
You must be signed in to change notification settings - Fork 9
172 lines (171 loc) · 5.76 KB
/
freeze.yaml
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
---
name: Create instawow executables
on: [push, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_COLOR: "1"
defaults:
run:
shell: bash
jobs:
build-package:
runs-on: ubuntu-latest
outputs:
wheel-name: ${{ steps.build-package.outputs.wheel-name }}
wheel-version: ${{ steps.build-package.outputs.wheel-version }}
steps:
- name: Clone the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build package
id: build-package
uses: ./.github/actions/build-package
freeze-cli:
needs: build-package
strategy:
fail-fast: false
matrix:
build-env:
- os: macos-12
rust-target: aarch64-apple-darwin
- os: macos-12
rust-target: x86_64-apple-darwin
- os: ubuntu-22.04
rust-target: aarch64-unknown-linux-gnu
- os: ubuntu-22.04
rust-target: x86_64-unknown-linux-gnu
# - os: windows-2022
# rust-target: aarch64-pc-windows-msvc
- os: windows-2022
rust-target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.build-env.os }}
steps:
- name: Clone the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download pre-built wheel
uses: actions/download-artifact@v3
id: download-wheel
with:
name: ${{ needs.build-package.outputs.wheel-name }}
path: ./dist
- name: Install Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Rust
run: rustup update stable
- name: Install cross-compilation toolchain
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.build-env.rust-target }}
- name: Install cross
uses: taiki-e/install-action@v2
with:
tool: cross
if: startsWith(matrix.build-env.os, 'ubuntu-')
- name: Install nox
run: python -m pip install nox
- name: Freeze the CLI
run: nox -s freeze_cli --
--wheel-file '${{ steps.download-wheel.outputs.download-path }}/${{ needs.build-package.outputs.wheel-name }}'
--out-dir ./dist-cli
env:
CARGO_BUILD_TARGET: ${{ matrix.build-env.rust-target }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: instawow-cli-${{ needs.build-package.outputs.wheel-version }}-${{ matrix.build-env.rust-target }}
path: ./dist-cli/instawow*
freeze-gui:
needs: build-package
strategy:
matrix:
build-env:
- os: macos-12
python-version: "3.11"
briefcase-build-opts: ""
briefcase-package-opts: "--adhoc-sign"
- os: ubuntu-20.04
python-version: "3.11"
briefcase-build-opts: "linux appimage --no-docker"
briefcase-package-opts: "linux appimage"
- os: windows-latest
python-version: "3.11"
briefcase-build-opts: ""
briefcase-package-opts: ""
fail-fast: false
runs-on: ${{ matrix.build-env.os }}
steps:
- name: Clone the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download pre-built wheel
uses: actions/download-artifact@v3
id: download-wheel
with:
name: ${{ needs.build-package.outputs.wheel-name }}
path: ./dist
- name: Install briefcase Linux dependencies
run: sudo apt-get update --fix-missing && sudo apt-get install -y
patchelf pkgconf
libgtk-3-dev libwebkit2gtk-4.0-dev
libgirepository1.0-dev gir1.2-javascriptcoregtk-4.0 gir1.2-webkit2-4.0
if: matrix.build-env.os == 'ubuntu-20.04'
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.build-env.python-version }}
- name: Install nox
run: pipx install nox
- name: Patch in the wheel dependency
run: >-
nox -s patch_frontend_spec --
--wheel-file '${{ steps.download-wheel.outputs.download-path }}/${{ needs.build-package.outputs.wheel-name }}'
- name: Patch in the version number
run: >-
nox -s patch_frontend_spec --
--version ${{ needs.build-package.outputs.wheel-version }}
if: startsWith(github.ref, 'refs/tags/')
- name: Install and run briefcase
run: |
python -m pip install 'briefcase @ git+https://github.com/layday/briefcase@instawow'
python -m briefcase build ${{ matrix.build-env.briefcase-build-opts }}
python -m briefcase package ${{ matrix.build-env.briefcase-package-opts }}
working-directory: gui-webview
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: instawow-gui-${{ needs.build-package.outputs.wheel-version }}-${{ matrix.build-env.os }}
path: |
gui-webview/dist/instawow-gui-*
if-no-files-found: error
create-release:
if: startsWith(github.ref, 'refs/tags/')
needs: [freeze-cli, freeze-gui]
runs-on: ubuntu-latest
steps:
- name: Download built artifacts
uses: actions/download-artifact@v3
with:
path: release-assets
- name: Zip up CLI directories
run: |
set +x
for d in instawow-cli-*
do
zip -r "${d%/}.zip" "$d"
done
working-directory: release-assets
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
release-assets/instawow-cli-*.zip
release-assets/instawow-gui-*/*