This repository has been archived by the owner on May 30, 2024. It is now read-only.
Publish FiveM LuaLS Addon #40
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
name: Publish FiveM LuaLS Addon | |
on: | |
push: | |
branches: [main] | |
schedule: | |
- cron: 0 0 * * SAT | |
jobs: | |
generate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Deno | |
uses: denoland/[email protected] | |
- name: Generate native definitions | |
run: deno task generate | |
- uses: JohnnyMorganz/stylua-action@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
version: latest | |
args: . | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: addon | |
path: addon/ | |
publish: | |
runs-on: ubuntu-latest | |
needs: generate | |
concurrency: publish | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
ref: dist | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: addon | |
- name: Publish to dist branch | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add . | |
git diff-index --quiet HEAD || git commit -am "🚀 Update $(date +'%H:%M:%S %d/%m/%Y')" | |
git push origin dist |