Publish #16
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish | |
| on: | |
| push: | |
| tags: v[0-9]+.[0-9]+.[0-9]+* | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| env: | |
| package_name: luarocks-build-lls-addon | |
| spec_version: "" # this gets set in the Get Rockspec Version step | |
| steps: | |
| - name: Get Rockspec Version | |
| run: | | |
| if [[ "${{ github.ref_name }}" =~ ^v(.+)$ ]]; then | |
| echo "spec_version=${BASH_REMATCH[1]}-1" >> $GITHUB_ENV | |
| else | |
| echo "rockspec version could not be matched" >&2 | |
| exit 1 | |
| fi | |
| - uses: actions/checkout@v6 | |
| - name: Set up Lua | |
| uses: leafo/gh-actions-lua@v12 | |
| with: | |
| luaVersion: "5.4" | |
| - name: Set up LuaRocks | |
| uses: leafo/gh-actions-luarocks@v6 | |
| with: | |
| luaRocksVersion: "3.13.0" | |
| - name: Write LuaRocks Rockspec | |
| run: | | |
| luarocks new_version \ | |
| --tag ${{ github.ref_name }} \ | |
| ${{ env.package_name }}-release-1.rockspec | |
| - name: Publish to LuaRocks | |
| run: | | |
| luarocks upload \ | |
| "./${{ env.package_name }}-${{ env.spec_version }}.rockspec" \ | |
| --api-key=${{ secrets.LUAROCKS_API_KEY }} | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: "${{ env.package_name }}-${{ env.spec_version }}.src.rock" |