-
-
Notifications
You must be signed in to change notification settings - Fork 223
169 lines (165 loc) · 7.57 KB
/
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: release
on:
workflow_run:
workflows: ["development"]
types:
- completed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
run-name: ${{ github.event.workflow_run.head_commit.message }}
jobs:
appimage-upload:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
# Use oldest ubuntu to make AppImage work
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.workflow_run.head_sha }}
- name: Install Qt
run: |
sudo apt-get update
sudo apt-get install -y qt5-default libqt5svg5-dev
- name: Build application
run: |
cd ${GITHUB_WORKSPACE}/application
qmake
make -j`nproc`
- name: Generate AppImage
run: |
sudo apt-get install -y libfuse2
cd ${GITHUB_WORKSPACE} && sh ./ci/appimage/bundle.sh
mv Dust3D-x86_64.AppImage dust3d-${{ github.event.workflow_run.head_branch }}.AppImage
- name: Publish latest build
env:
MY_EMAIL: ${{ secrets.MY_EMAIL }}
UPDATE_REPO_TOKEN: ${{ secrets.UPDATE_REPO_TOKEN }}
run: |
git config --global user.email "${{ env.MY_EMAIL }}"
git config --global user.name "Jeremy HU"
git clone https://${{ env.UPDATE_REPO_TOKEN }}@github.com/huxingyi/huxingyi.github.io.git
cd huxingyi.github.io
git remote set-url origin https://${{ env.UPDATE_REPO_TOKEN }}@github.com/huxingyi/huxingyi.github.io.git
cp ../dust3d-${{ github.event.workflow_run.head_branch }}.AppImage download/dust3d-latest-preview.AppImage
git add download/dust3d-latest-preview.AppImage
git commit -m "Update latest build for linux"
git push origin HEAD
cd ../
- name: Upload AppImage
uses: actions/upload-artifact@v3
with:
name: dust3d-${{ github.event.workflow_run.head_branch }}.AppImage
path: dust3d-${{ github.event.workflow_run.head_branch }}.AppImage
win32-msvc-upload:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.workflow_run.head_sha }}
- name: Set up Visual Studio shell
uses: egor-tensin/vs-shell@v2
with:
arch: x64
- name: Install Qt
# Generated by https://ddalcino.github.io/aqt-list-server/
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==2.1.*'
version: '5.15.2'
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2019_64'
archives: 'qttools qtsvg qtimageformats qtbase opengl32sw'
- name: Build application
run: |
cd $env:GITHUB_WORKSPACE/application
qmake -spec win32-msvc
nmake -f Makefile.Release
- name: Set environment variable
run: |
set PATH="%PATH%;C:\Program Files\7-Zip"
- name: Zip executable
run: |
7z a Dust3D-win32-x86_64.zip ${GITHUB_WORKSPACE}/application/release/dust3d.exe
7z a Dust3D-win32-x86_64.zip ${GITHUB_WORKSPACE}/../Qt/5.15.2/msvc2019_64/bin/Qt5Svg.dll
7z a Dust3D-win32-x86_64.zip ${GITHUB_WORKSPACE}/../Qt/5.15.2/msvc2019_64/bin/Qt5Widgets.dll
7z a Dust3D-win32-x86_64.zip ${GITHUB_WORKSPACE}/../Qt/5.15.2/msvc2019_64/bin/Qt5Gui.dll
7z a Dust3D-win32-x86_64.zip ${GITHUB_WORKSPACE}/../Qt/5.15.2/msvc2019_64/bin/Qt5Core.dll
7z a Dust3D-win32-x86_64.zip ${GITHUB_WORKSPACE}/../Qt/5.15.2/msvc2019_64/bin/opengl32sw.dll
ls "${VCToolsRedistDir}x64"
ls "${VCToolsRedistDir}x64/Microsoft.VC142.CRT"
7z a Dust3D-win32-x86_64.zip "${VCToolsRedistDir}x64/Microsoft.VC142.CRT/msvcp140.dll"
7z a Dust3D-win32-x86_64.zip "${VCToolsRedistDir}x64/Microsoft.VC142.CRT/msvcp140_1.dll"
7z a Dust3D-win32-x86_64.zip "${VCToolsRedistDir}x64/Microsoft.VC142.CRT/vcruntime140.dll"
7z a Dust3D-win32-x86_64.zip "${VCToolsRedistDir}x64/Microsoft.VC142.CRT/vcruntime140_1.dll"
mkdir ${GITHUB_WORKSPACE}/platforms
cp ${GITHUB_WORKSPACE}/../Qt/5.15.2/msvc2019_64/plugins/platforms/qwindows.dll ${GITHUB_WORKSPACE}/platforms/qwindows.dll
7z a Dust3D-win32-x86_64.zip -r ${GITHUB_WORKSPACE}/platforms/
mkdir ${GITHUB_WORKSPACE}/imageformats
cp ${GITHUB_WORKSPACE}/../Qt/5.15.2/msvc2019_64/plugins/imageformats/qjpeg.dll ${GITHUB_WORKSPACE}/imageformats/qjpeg.dll
cp ${GITHUB_WORKSPACE}/../Qt/5.15.2/msvc2019_64/plugins/imageformats/qsvg.dll ${GITHUB_WORKSPACE}/imageformats/qsvg.dll
7z a Dust3D-win32-x86_64.zip -r ${GITHUB_WORKSPACE}/imageformats/
7z x Dust3D-win32-x86_64.zip -odust3d-${{ github.event.workflow_run.head_branch }}
shell: bash
- name: Publish latest build
env:
MY_EMAIL: ${{ secrets.MY_EMAIL }}
UPDATE_REPO_TOKEN: ${{ secrets.UPDATE_REPO_TOKEN }}
run: |
git config --global user.email "${{ env.MY_EMAIL }}"
git config --global user.name "Jeremy HU"
git clone https://${{ env.UPDATE_REPO_TOKEN }}@github.com/huxingyi/huxingyi.github.io.git
cd huxingyi.github.io
git remote set-url origin https://${{ env.UPDATE_REPO_TOKEN }}@github.com/huxingyi/huxingyi.github.io.git
cp ../Dust3D-win32-x86_64.zip download/dust3d-latest-preview.zip
git add download/dust3d-latest-preview.zip
git commit -m "Update latest build for windows"
git push origin HEAD
cd ../
- name: Upload zip
uses: actions/upload-artifact@v3
with:
name: dust3d-${{ github.event.workflow_run.head_branch }}
path: dust3d-${{ github.event.workflow_run.head_branch }}/
macos-upload:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install Qt
run: |
HOMEBREW_VERBOSE_USING_DOTS=1 brew reinstall --verbose qt@5
HOMEBREW_VERBOSE_USING_DOTS=1 brew link qt@5 --force
export PATH="/usr/local/opt/qt@5/bin:$PATH"
- name: Build application
run: |
cd ${GITHUB_WORKSPACE}/application
qmake
alias nproc="sysctl -n hw.logicalcpu"
make -j`nproc`
- name: Generate DMG
run: |
mv ${GITHUB_WORKSPACE}/application/dust3d.app dust3d-${{ github.event.workflow_run.head_branch }}.app
macdeployqt dust3d-${{ github.event.workflow_run.head_branch }}.app -dmg
- name: Publish latest build
env:
MY_EMAIL: ${{ secrets.MY_EMAIL }}
UPDATE_REPO_TOKEN: ${{ secrets.UPDATE_REPO_TOKEN }}
run: |
git config --global user.email "${{ env.MY_EMAIL }}"
git config --global user.name "Jeremy HU"
git clone https://${{ env.UPDATE_REPO_TOKEN }}@github.com/huxingyi/huxingyi.github.io.git
cd huxingyi.github.io
git remote set-url origin https://${{ env.UPDATE_REPO_TOKEN }}@github.com/huxingyi/huxingyi.github.io.git
cp ../dust3d-${{ github.event.workflow_run.head_branch }}.dmg download/dust3d-latest-preview.dmg
git add download/dust3d-latest-preview.dmg
git commit -m "Update latest build for macos"
git push origin HEAD
cd ../
- name: Upload DMG
uses: actions/upload-artifact@v3
with:
name: dust3d-${{ github.event.workflow_run.head_branch }}.dmg
path: dust3d-${{ github.event.workflow_run.head_branch }}.dmg