diff options
author | numToStr <vikasraj1911@gmail.com> | 2021-12-07 20:24:14 +0530 |
---|---|---|
committer | numToStr <vikasraj1911@gmail.com> | 2021-12-14 18:57:58 +0530 |
commit | 9bc668225e5c866b8cccf275ba71c9e705768ea3 (patch) | |
tree | 476e14ab78c64782e77701ef69ff090f82cd5b17 /.github/workflows | |
parent | 4f53539a656fefb9f48168a123e8773675ecf181 (diff) | |
download | lua-language-server-9bc668225e5c866b8cccf275ba71c9e705768ea3.zip |
feat: publish platform release assets
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/build.yml | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8b7601f9..cc180f9d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,14 +1,19 @@ name: build on: push + +env: + PROJECT: lua-language-server + BIN: bin + jobs: compile: strategy: fail-fast: false matrix: job: - - { os: windows-latest, target: windows } - { os: ubuntu-18.04, target: linux } - { os: macos-latest, target: macos } + - { os: windows-latest, target: windows } runs-on: ${{ matrix.job.os }} steps: - uses: actions/checkout@v2 @@ -18,10 +23,39 @@ jobs: - uses: actboy168/setup-luamake@master - - name: Running `luamake` - run: luamake + - run: luamake - uses: actions/upload-artifact@v2 with: - name: lua-language-server-${{ matrix.job.target }} - path: bin + name: ${{ env.PROJECT }}-${{ matrix.job.target }} + path: ${{ env.BIN }} + + - name: Package + if: startsWith(github.ref, 'refs/tags/') + id: package + shell: bash + run: | + PKG_BASENAME="${{ env.PROJECT }}-${{ matrix.job.target }}" + + pushd "${{ env.BIN }}/" >/dev/null + case "${{ matrix.job.target }}" in + windows) + PKG_NAME="${PKG_BASENAME}.zip" + 7z -y a ${PKG_NAME} * | tail -2 + ;; + *) + PKG_NAME="${PKG_BASENAME}.tar.gz" + tar czf ${PKG_NAME} * + ;; + esac; + popd >/dev/null + + echo ::set-output name=PKG_PATH::"${{ env.BIN }}/${PKG_NAME}" + echo ::set-output name=PKG_NAME::${PKG_NAME} + + - name: Publish release assets + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + generate_release_notes: true + files: ${{ steps.package.outputs.PKG_PATH }} |