-
Notifications
You must be signed in to change notification settings - Fork 5
177 lines (157 loc) · 5.21 KB
/
build_dist.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
name: Build distribution
on:
push:
branches: [ master ]
tags: [ '*' ]
env:
SHELL: /bin/bash
jobs:
buildNative:
runs-on: ubuntu-latest
container: archlinux/archlinux:multilib-devel
steps:
# Install packages
- run: pacman --noconfirm -Sy sbt jdk-openjdk git mingw-w64 clang nasm rustup python3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
default: true
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: i686-pc-windows-gnu
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: i686-unknown-linux-gnu
# Initialize git
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- run: git config --global --add safe.directory /__w/MPPatch/MPPatch
- run: git fetch --prune --unshallow --tags
# Do the actual build
- run: scripts/ci/build-natives_linux.sh
# Upload artifacts
- uses: actions/upload-artifact@v3
with:
name: mppatch_ci_natives-linux.tar.gz
path: target/mppatch_ci_natives-linux.tar.gz
buildInstallerLinux:
runs-on: ubuntu-latest
needs:
- buildNative
steps:
# Install packages
- uses: actions/setup-java@v3
with:
distribution: 'liberica'
java-version: '21'
- run: sudo apt install libfuse2
# Initialize git
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- run: git fetch --prune --unshallow --tags
# Download artifacts
- uses: actions/download-artifact@v3
with:
name: mppatch_ci_natives-linux.tar.gz
path: target/mppatch_ci_natives-linux
- run: mv target/mppatch_ci_natives-linux/* target/
- run: rm -rf target/mppatch_ci_natives-linux
# Do the actual build
- run: scripts/ci/build-installer_linux.sh
# Upload artifacts
- uses: actions/upload-artifact@v3
with:
name: mppatch_ci_installer-linux.tar.gz
path: target/mppatch_ci_installer-linux.tar.gz
buildInstallerWindows:
runs-on: windows-latest
needs:
- buildNative
steps:
# Install packages
- uses: actions/setup-java@v3
with:
distribution: 'liberica'
java-version: '21'
# Initialize git
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- run: git fetch --prune --unshallow --tags
# Install dependencies
- uses: ilammy/msvc-dev-cmd@v1
- name: Install NSIS
run: |
iwr -useb get.scoop.sh -outfile 'install.ps1'
.\install.ps1 -RunAsAdmin
scoop update
scoop bucket add extras
scoop install nsis
# Download artifacts
- uses: actions/download-artifact@v3
with:
name: mppatch_ci_natives-linux.tar.gz
path: target/mppatch_ci_natives-linux
- run: mv target/mppatch_ci_natives-linux/* target/
- run: rm -Recurse -Force -Verbose target/mppatch_ci_natives-linux
# Do the actual build
- run: powershell -file scripts/ci/build-installer_win32.ps1
# Upload artifacts
- uses: actions/upload-artifact@v3
with:
name: mppatch_ci_installer-win32.tar.gz
path: target/mppatch_ci_installer-win32.tar.gz
publishArtifacts:
runs-on: ubuntu-latest
needs:
- buildInstallerLinux
- buildInstallerWindows
steps:
# Initialize git
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Fetch git tags.
run: git fetch --prune --unshallow --tags
- name: Get version as Github variable.
run: 'echo "VERSION_STR=ci_build-$GITHUB_RUN_NUMBER" >> $GITHUB_ENV'
# Download artifacts
- run: mkdir -pv target
- uses: actions/download-artifact@v3
with:
name: mppatch_ci_installer-linux.tar.gz
path: target/mppatch_ci_installer-linux
- uses: actions/download-artifact@v3
with:
name: mppatch_ci_installer-win32.tar.gz
path: target/mppatch_ci_installer-win32
- name: Build directory structure
run: |
mkdir -pv target/dist
cd target/dist
tar -xv -f ../mppatch_ci_installer-linux/mppatch_ci_installer-linux.tar.gz
tar -xv -f ../mppatch_ci_installer-win32/mppatch_ci_installer-win32.tar.gz
# Upload the build to GitHub
- name: Remove git hooks (hack to make action-create-tag work)
run: 'rm -rfv .git/hooks/*'
- uses: rickstaa/action-create-tag@v1
with:
tag: ${{ env.VERSION_STR }}
message: CI release ${{ env.VERSION_STR }}
- uses: softprops/action-gh-release@v1
with:
name: ${{ env.VERSION_STR }}
tag_name: ${{ env.VERSION_STR }}
body: |
CI Build ${{ env.VERSION_STR }}
This is an development build.
Expect that things may be completely broken or for there to be subtle game-breaking bugs.
Use this build at your own risk.
prerelease: true
files: target/dist/**
fail_on_unmatched_files: true
generate_release_notes: true