ci(workspace): add release workflow and fix lua CI scripts
This commit is contained in:
parent
3a6e51d017
commit
f974112d2b
19
.github/workflows/ci.yml
vendored
19
.github/workflows/ci.yml
vendored
|
|
@ -25,7 +25,7 @@ jobs:
|
||||||
run: cargo fmt --all -- --check
|
run: cargo fmt --all -- --check
|
||||||
|
|
||||||
- name: Run Clippy
|
- name: Run Clippy
|
||||||
# -D warnings turns all clippy warnings into hard errors that fail the build
|
# The `-D warnings` flag converts all clippy warnings into hard errors, causing the build to fail.
|
||||||
run: cargo clippy --all-targets --all-features -- -D warnings
|
run: cargo clippy --all-targets --all-features -- -D warnings
|
||||||
|
|
||||||
lua-lint:
|
lua-lint:
|
||||||
|
|
@ -41,12 +41,13 @@ jobs:
|
||||||
version: latest
|
version: latest
|
||||||
|
|
||||||
- name: Check Lua Formatting
|
- name: Check Lua Formatting
|
||||||
# We use a glob that won't fail if the directories don't exist yet
|
# A conditional search is used to prevent failures when no Lua files exist yet.
|
||||||
run: |
|
run: |
|
||||||
if [ -d "assets/scripts" ] || [ -d "mods" ]; then
|
LUA_FILES=$(find assets/scripts mods -name "*.lua" 2>/dev/null || true)
|
||||||
stylua --check assets/scripts/ mods/ 2>/dev/null || true
|
if [ -z "$LUA_FILES" ]; then
|
||||||
|
echo "No Lua files found to format."
|
||||||
else
|
else
|
||||||
echo "No Lua scripts found to format yet."
|
echo "$LUA_FILES" | xargs stylua --check
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Install Selene
|
- name: Install Selene
|
||||||
|
|
@ -55,9 +56,11 @@ jobs:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Run Selene
|
- name: Run Selene
|
||||||
|
# A conditional search is used to prevent failures when no Lua files exist yet.
|
||||||
run: |
|
run: |
|
||||||
if [ -d "assets/scripts" ] || [ -d "mods" ]; then
|
LUA_FILES=$(find assets/scripts mods -name "*.lua" 2>/dev/null || true)
|
||||||
selene assets/scripts/ mods/ 2>/dev/null || true
|
if [ -z "$LUA_FILES" ]; then
|
||||||
|
echo "No Lua files found to lint."
|
||||||
else
|
else
|
||||||
echo "No Lua scripts found to lint yet."
|
echo "$LUA_FILES" | xargs selene
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
28
.github/workflows/release.yml
vendored
Normal file
28
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
# The workflow triggers only when a tag matching the pattern (e.g., v0.1.0) is pushed.
|
||||||
|
tags:
|
||||||
|
- "v*.*.*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
create-release:
|
||||||
|
name: Create GitHub Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
# Write permission is required for the action to create a release.
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
# Release notes are generated automatically based on pull requests merged since the last tag.
|
||||||
|
generate_release_notes: true
|
||||||
|
|
||||||
|
# NOTE: Build steps can be added prior to this step to compile platform binaries.
|
||||||
|
# The resulting artifacts can then be attached to the release using the `files` parameter.
|
||||||
Loading…
Reference in a new issue