forked from GenghisYoung233/Gaofen-Batch
-
Notifications
You must be signed in to change notification settings - Fork 0
193 lines (170 loc) · 6.82 KB
/
build_parallel.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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: Build Windows Parallel
on:
workflow_dispatch:
push:
branches:
- main
jobs:
download_otb:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- run: mkdir OTB-9.0.0-Win64
- name: Get otb cache directory
id: otb-cache
shell: pwsh
run: echo "dir=$(pwd)\OTB-9.0.0-Win64" >> ${env:GITHUB_OUTPUT}
- name: otb cache
uses: actions/cache@v3
with:
path: ${{ steps.otb-cache.outputs.dir }}
key: ${{ runner.os }}-otb-${{ hashFiles('**/main.py') }}
restore-keys: |
${{ runner.os }}-otb-
- if: ${{ steps.otb-cache.outputs.cache-hit != 'true'}}
name: download OTB-9.0.0-Win64.zip
uses: gamedev-thingy/Download-Extract@done
with:
url: https://www.orfeo-toolbox.org/packages/OTB-9.0.0-Win64.zip
destination: OTB-9.0.0-Win64
ZIPname: OTB-9.0.0-Win64
- run: |
7z a -tzip OTB-9.0.0-Win64.zip OTB-9.0.0-Win64/*
- name: Upload OTB
uses: actions/upload-artifact@v4
with:
# Artifact name
name: OTB-9.0.0-Win64
# A file, directory or wildcard pattern that describes what to upload
path: "OTB-9.0.0-Win64.zip"
build_python_app:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Get pip cache dir
id: pip-cache
run: echo "dir=$(pip cache dir)" >> ${env:GITHUB_OUTPUT}
- name: pip cache
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: install python
uses: actions/setup-python@v5
with:
python-version: '3.8'
cache: 'pip' # caching pip dependencies
- name: building
run: |
pip install -r requirements.txt
pip install nuitka
pip install nuitka --standalone
nuitka main.py
cp -r "data" "main.dist"
ren "main.dist" "bin"
7z a -tzip bin.zip bin/*
- name: Upload
uses: actions/upload-artifact@v4
with:
# Artifact name
name: bin
# A file, directory or wildcard pattern that describes what to upload
path: "bin.zip"
build_electron_app:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
# Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0.
# node-version: 20.x
# File containing the version Spec of the version to use. Examples: package.json, .nvmrc, .node-version, .tool-versions.
architecture: package.json
# Set this option if you want the action to check for the latest available version that satisfies the version spec.
check-latest: true
# Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm.
cache: npm
# Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies.
cache-dependency-path: package-lock.json
- name: Get npm cache directory
id: npm-cache-dir
shell: pwsh
run: echo "dir=$(npm config get cache)" >> ${env:GITHUB_OUTPUT}
- name: npm cache
uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: building and pack
run: |
npm install
npm run pack
tree
- name: Upload
uses: actions/upload-artifact@v4
with:
# Artifact name
name: electron_app
# A file, directory or wildcard pattern that describes what to upload
path: "dist/win-unpacked"
pack_app:
needs: [download_otb, build_python_app, build_electron_app]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
# Name of the artifact to download.
# If unspecified, all artifacts for the run are downloaded.
# Optional.
name: OTB-9.0.0-Win64
# Destination path. Supports basic tilde expansion.
# Optional. Default is $GITHUB_WORKSPACE
# path:
# A glob pattern to the artifacts that should be downloaded.
# Ignored if name is specified.
# Optional.
# pattern:
# When multiple artifacts are matched, this changes the behavior of the destination directories.
# If true, the downloaded artifacts will be in the same directory specified by path.
# If false, the downloaded artifacts will be extracted into individual named directories within the specified path.
# Optional. Default is 'false'
# merge-multiple:
# The GitHub token used to authenticate with the GitHub API.
# This is required when downloading artifacts from a different repository or from a different workflow run.
# Optional. If unspecified, the action will download artifacts from the current repo and the current workflow run.
# github-token:
# The repository owner and the repository name joined together by "/".
# If github-token is specified, this is the repository that artifacts will be downloaded from.
# Optional. Default is ${{ github.repository }}
repository: ${{ github.repository }}
# The id of the workflow run where the desired download artifact was uploaded from.
# If github-token is specified, this is the run that artifacts will be downloaded from.
# Optional. Default is ${{ github.run_id }}
# run-id:
- uses: actions/download-artifact@v4
with:
# Name of the artifact to download.
# If unspecified, all artifacts for the run are downloaded.
# Optional.
name: bin
- uses: actions/download-artifact@v4
with:
# Name of the artifact to download.
# If unspecified, all artifacts for the run are downloaded.
# Optional.
name: electron_app
path: win_64
- run: |
7z x -o"win_64" "bin.zip"
7z x -o"win_64/bin" "OTB-9.0.0-Win64.zip"
dir
dir "win_64"
dir "win_64/bin"
dir "win_64/bin/OTB-9.0.0-Win64"