77 push :
88 branches :
99 - master
10- tags :
11- - " *"
1210 pull_request :
1311 branches :
1412 - master
@@ -23,71 +21,30 @@ jobs:
2321 fail-fast : false
2422 matrix :
2523 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 }
2926 - { os: macos-11, target: darwin, platform: darwin-x64 }
3027 - { os: macos-11, target: darwin, platform: darwin-arm64 }
3128 - { os: windows-latest, target: windows, platform: win32-ia32 }
3229 - { os: windows-latest, target: windows, platform: win32-x64 }
3330 runs-on : ${{ matrix.os }}
34- container :
35- image : ${{ matrix.container }}
3631 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-
6532 - uses : actions/checkout@v3
6633 with :
6734 submodules : recursive
6835
69- - name : Build for others step-1
70- if : ${{ matrix.libc != 'musl' }}
36+ - name : Install Luamake
7137 uses : actboy168/setup-luamake@master
7238
73- - name : Build for others step-2
74- if : ${{ matrix.libc != 'musl' }}
39+ - name : Luamake
7540 run : luamake -platform ${{ matrix.platform }}
7641
77- - name : Build for musl
78- if : ${{ matrix.target == 'linux' && matrix.libc == 'musl' }}
79- run : ./make.sh
80-
8142 - name : Setting up workflow variables
8243 id : vars
8344 shell : bash
8445 run : |
8546 # 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}
9148
9249 # Package suffix relative to the platform
9350 if [[ "${{ matrix.target }}" = windows ]]; then
9855
9956 # Package name w/ version
10057 PKG_BASENAME="${{ env.PROJECT }}-${PKG_VERSION}-${{ matrix.platform }}"
101- if [[ "${{ matrix.libc }}" = musl ]]; then
102- PKG_BASENAME="${PKG_BASENAME}-${{matrix.libc}}"
103- fi
10458
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
11259 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
11660
11761 - uses : actions/upload-artifact@v3
11862 with :
@@ -127,47 +71,3 @@ jobs:
12771 doc
12872 meta
12973 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