7
7
push :
8
8
branches :
9
9
- master
10
- tags :
11
- - " *"
12
10
pull_request :
13
11
branches :
14
12
- master
@@ -23,71 +21,30 @@ jobs:
23
21
fail-fast : false
24
22
matrix :
25
23
include :
26
- - { os: ubuntu-22.04, target: linux, platform: linux-x64, container: 'alpine:latest', libc: musl }
27
- - { os: ubuntu-20.04, target: linux, platform: linux-x64, container: 'ubuntu:18.04' }
28
- - { os: ubuntu-20.04, target: linux, platform: linux-arm64, container: 'ubuntu:18.04' }
24
+ - { os: ubuntu-20.04, target: linux, platform: linux-x64 }
25
+ - { os: ubuntu-20.04, target: linux, platform: linux-arm64 }
29
26
- { os: macos-11, target: darwin, platform: darwin-x64 }
30
27
- { os: macos-11, target: darwin, platform: darwin-arm64 }
31
28
- { os: windows-latest, target: windows, platform: win32-ia32 }
32
29
- { os: windows-latest, target: windows, platform: win32-x64 }
33
30
runs-on : ${{ matrix.os }}
34
- container :
35
- image : ${{ matrix.container }}
36
31
steps :
37
- - name : Prepare container
38
- if : ${{ matrix.target == 'linux' && matrix.libc != 'musl' }}
39
- run : |
40
- apt-get update
41
- apt-get install -y software-properties-common
42
- add-apt-repository -y ppa:ubuntu-toolchain-r/test # For gcc-9 and g++-9
43
- add-apt-repository -y ppa:git-core/ppa # For git>=2.18.
44
- apt-get update
45
- apt-get install -y sudo git gcc-9 g++-9
46
-
47
- - name : Install aarch64-linux-gnu
48
- if : ${{ matrix.platform == 'linux-arm64' && matrix.libc != 'musl' }}
49
- run : |
50
- apt-get update
51
- apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
52
-
53
- - name : Prepare container env
54
- if : ${{ matrix.target == 'linux' && matrix.libc != 'musl' }}
55
- run : |
56
- update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100
57
- update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 100
58
-
59
- - name : Prepare container for musl
60
- if : ${{ matrix.target == 'linux' && matrix.libc == 'musl' }}
61
- run : |
62
- apk update
63
- apk add git ninja bash build-base nodejs linux-headers
64
-
65
32
- uses : actions/checkout@v3
66
33
with :
67
34
submodules : recursive
68
35
69
- - name : Build for others step-1
70
- if : ${{ matrix.libc != 'musl' }}
36
+ - name : Install Luamake
71
37
uses : actboy168/setup-luamake@master
72
38
73
- - name : Build for others step-2
74
- if : ${{ matrix.libc != 'musl' }}
39
+ - name : Luamake
75
40
run : luamake -platform ${{ matrix.platform }}
76
41
77
- - name : Build for musl
78
- if : ${{ matrix.target == 'linux' && matrix.libc == 'musl' }}
79
- run : ./make.sh
80
-
81
42
- name : Setting up workflow variables
82
43
id : vars
83
44
shell : bash
84
45
run : |
85
46
# Package version
86
- if [[ $GITHUB_REF = refs/tags/* ]]; then
87
- PKG_VERSION=${GITHUB_REF##*/}
88
- else
89
- PKG_VERSION=${GITHUB_SHA:0:7}
90
- fi
47
+ PKG_VERSION=${GITHUB_SHA:0:7}
91
48
92
49
# Package suffix relative to the platform
93
50
if [[ "${{ matrix.target }}" = windows ]]; then
98
55
99
56
# Package name w/ version
100
57
PKG_BASENAME="${{ env.PROJECT }}-${PKG_VERSION}-${{ matrix.platform }}"
101
- if [[ "${{ matrix.libc }}" = musl ]]; then
102
- PKG_BASENAME="${PKG_BASENAME}-${{matrix.libc}}"
103
- fi
104
58
105
- # Full name of the tarball asset
106
- PKG_NAME="${PKG_BASENAME}.${PKG_SUFFIX}"
107
-
108
- # Staging area for tarballs
109
- PKG_STAGING="ci_staging/$PKG_BASENAME"
110
-
111
- echo PKG_VERSION=${PKG_VERSION} >> $GITHUB_OUTPUT
112
59
echo PKG_BASENAME=${PKG_BASENAME} >> $GITHUB_OUTPUT
113
- echo PKG_NAME=${PKG_NAME} >> $GITHUB_OUTPUT
114
- echo PKG_PATH="${PKG_STAGING}/${PKG_NAME}" >> $GITHUB_OUTPUT
115
- echo PKG_STAGING=${PKG_STAGING} >> $GITHUB_OUTPUT
116
60
117
61
- uses : actions/upload-artifact@v3
118
62
with :
@@ -127,47 +71,3 @@ jobs:
127
71
doc
128
72
meta
129
73
script
130
-
131
- - name : Package tarballs
132
- if : startsWith(github.ref, 'refs/tags/')
133
- shell : bash
134
- run : |
135
- STAGING=${{ steps.vars.outputs.PKG_STAGING }}
136
- NAME=${{ steps.vars.outputs.PKG_NAME }}
137
-
138
- # Making the staging area
139
- mkdir -p ${STAGING}
140
-
141
- # Copying binary and runtime files to staging area
142
- cp -r main.lua debugger.lua LICENSE changelog.md locale meta script ${{ env.BIN_DIR }} ${STAGING}
143
-
144
- # Creating release assets
145
- pushd "${STAGING}/" >/dev/null
146
- if [[ "${{ matrix.target }}" = windows ]]; then
147
- 7z -y a ${NAME} * | tail -2
148
- else
149
- tar czf ${NAME} *
150
- fi
151
- popd >/dev/null
152
-
153
- # Packaging submodules for homebrew distribution
154
- - name : Package submodules
155
- id : submodules
156
- if : ${{ startsWith(github.ref, 'refs/tags/') && matrix.platform == 'darwin-x64' }}
157
- run : |
158
- STAGING=${{ steps.vars.outputs.PKG_STAGING }}
159
- PKG_SUBMOD_NAME="${{ env.PROJECT }}-${{ steps.vars.outputs.PKG_VERSION }}-submodules.zip"
160
- PKG_SUBMOD_PATH="${STAGING}/$PKG_SUBMOD_NAME"
161
-
162
- zip -r $PKG_SUBMOD_PATH ./ -x "*.git*" -x "*.vscode*" -x "build*" -x "${{ env.BIN_DIR }}*" -x "${STAGING}*" -x "3rd/json.lua*" -x "log*" -x "ci_staging*"
163
-
164
- echo PKG_SUBMOD_PATH=${PKG_SUBMOD_PATH} >> $GITHUB_OUTPUT
165
-
166
- - name : Publish release assets
167
- uses : softprops/action-gh-release@v1
168
- if : startsWith(github.ref, 'refs/tags/')
169
- with :
170
- generate_release_notes : true
171
- files : |
172
- ${{ steps.vars.outputs.PKG_PATH }}
173
- ${{ steps.submodules.outputs.PKG_SUBMOD_PATH }}
0 commit comments