✨ Supporting using git to get project name #74
This file contains 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
--- | |
"on": | |
push: | |
paths-ignore: | |
- "**.md" | |
pull_request: | |
paths-ignore: | |
- "**.md" | |
workflow_dispatch: | |
# https://github.com/softprops/action-gh-release/issues/236 | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: leafo/gh-actions-lua@v10 | |
- uses: leafo/gh-actions-luarocks@v4 | |
- name: Build | |
run: | | |
luarocks pack ./*.rockspec | |
luarocks build | |
luarocks pack prompt-style | |
- uses: actions/upload-artifact@v3 | |
if: "! startsWith(github.ref, 'refs/tags/')" | |
with: | |
path: | | |
*.rock | |
- uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
# body_path: build/CHANGELOG.md | |
files: | | |
*.rock | |
- name: Upload | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
# https://github.com/luarocks/luarocks/issues/559 | |
luarocks install dkjson | |
luarocks upload ./*.rockspec --api-key ${{secrets.LUAROCKS_API_KEY}} | |
deploy-aur: | |
needs: build | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: Freed-Wu/[email protected] | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
package_name: lua-prompt-style | |
ssh_private_key: ${{secrets.AUR_SSH_PRIVATE_KEY}} | |
deploy-nur: | |
needs: build | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Trigger Workflow | |
run: > | |
curl -X POST -d '{"ref":"main"}' | |
-H "Accept: application/vnd.github.v3+json" | |
-H "Authorization: Bearer ${{secrets.GH_TOKEN}}" | |
https://api.github.com/repos/Freed-Wu/nur-packages/actions/workflows/version.yml/dispatches |