11name : build
22on : push
3+
4+ env :
5+ PROJECT : lua-language-server
6+ BIN : bin
7+
38jobs :
49 compile :
510 strategy :
611 fail-fast : false
712 matrix :
813 job :
9- - { os: windows-latest, target: windows }
1014 - { os: ubuntu-18.04, target: linux }
1115 - { os: macos-latest, target: macos }
16+ - { os: windows-latest, target: windows }
1217 runs-on : ${{ matrix.job.os }}
1318 steps :
1419 - uses : actions/checkout@v2
@@ -18,10 +23,39 @@ jobs:
1823
1924 - uses : actboy168/setup-luamake@master
2025
21- - name : Running `luamake`
22- run : luamake
26+ - run : luamake
2327
2428 - uses : actions/upload-artifact@v2
2529 with :
26- name : lua-language-server-${{ matrix.job.target }}
27- path : bin
30+ name : ${{ env.PROJECT }}-${{ matrix.job.target }}
31+ path : ${{ env.BIN }}
32+
33+ - name : Package
34+ if : startsWith(github.ref, 'refs/tags/')
35+ id : package
36+ shell : bash
37+ run : |
38+ PKG_BASENAME="${{ env.PROJECT }}-${{ matrix.job.target }}"
39+
40+ pushd "${{ env.BIN }}/" >/dev/null
41+ case "${{ matrix.job.target }}" in
42+ windows)
43+ PKG_NAME="${PKG_BASENAME}.zip"
44+ 7z -y a ${PKG_NAME} * | tail -2
45+ ;;
46+ *)
47+ PKG_NAME="${PKG_BASENAME}.tar.gz"
48+ tar czf ${PKG_NAME} *
49+ ;;
50+ esac;
51+ popd >/dev/null
52+
53+ echo ::set-output name=PKG_PATH::"${{ env.BIN }}/${PKG_NAME}"
54+ echo ::set-output name=PKG_NAME::${PKG_NAME}
55+
56+ - name : Publish release assets
57+ uses : softprops/action-gh-release@v1
58+ if : startsWith(github.ref, 'refs/tags/')
59+ with :
60+ generate_release_notes : true
61+ files : ${{ steps.package.outputs.PKG_PATH }}
0 commit comments