Test config Workflow
This commit is contained in:
30
.github/workflows/changelog.yml
vendored
30
.github/workflows/changelog.yml
vendored
@@ -1,30 +0,0 @@
|
||||
name: Generate Changelog
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'src/**'
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
changelog:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Generate changelog
|
||||
id: changelog
|
||||
uses: heinrichreimer/github-changelog-generator-action@v2.3
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Commit updated changelog
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git add CHANGELOG.md
|
||||
git commit -m "Update changelog" || true
|
||||
git push
|
||||
47
.github/workflows/docs.yml
vendored
47
.github/workflows/docs.yml
vendored
@@ -1,47 +0,0 @@
|
||||
name: Build Docs
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'src/**'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'src/**'
|
||||
jobs:
|
||||
build:
|
||||
name: Build docs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Setup Lua
|
||||
uses: leafo/gh-actions-lua@v8
|
||||
with:
|
||||
luaVersion: 5.4
|
||||
- name: Checkout existing docs
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: gh-pages
|
||||
path: build_docs
|
||||
- name: Prepare references directory
|
||||
run: |
|
||||
mkdir -p build_docs/docs
|
||||
rm -rf build_docs/docs/references
|
||||
mkdir -p build_docs/docs/references
|
||||
- name: Process markdown files
|
||||
run: |
|
||||
find src -type f -name "*.lua" | while read file; do
|
||||
filename=$(basename "$file")
|
||||
if [ "$filename" != "LuaLS.lua" ]; then
|
||||
lua tools/markdown.lua "$file" "build_docs/docs/references/${filename%.lua}.md"
|
||||
fi
|
||||
done
|
||||
- name: Deploy
|
||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./build_docs
|
||||
36
.github/workflows/lualsgen.yml
vendored
36
.github/workflows/lualsgen.yml
vendored
@@ -1,36 +0,0 @@
|
||||
name: Generate LuaLS Definitions
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'src/elements/**'
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
paths:
|
||||
- 'src/elements/**'
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
generate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Lua
|
||||
uses: leafo/gh-actions-lua@v8
|
||||
with:
|
||||
luaVersion: "5.4"
|
||||
|
||||
- name: Generate LuaLS definitions
|
||||
run: |
|
||||
lua tools/annotationParser.lua src/elements src/LuaLS.lua
|
||||
|
||||
- name: Commit changes
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git add src/LuaLS.lua
|
||||
git commit -m "Update LuaLS definitions" || true
|
||||
git push
|
||||
58
.github/workflows/release.yml
vendored
58
.github/workflows/release.yml
vendored
@@ -1,58 +0,0 @@
|
||||
name: Create Release
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Minify Lua Code"]
|
||||
types:
|
||||
- completed
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
release:
|
||||
if: |
|
||||
github.event.workflow_run.conclusion == 'success' &&
|
||||
contains(github.event.workflow_run.head_commit.modified, 'version')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get Version
|
||||
id: version
|
||||
run: echo "version=$(cat version)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Check if version file changed
|
||||
run: |
|
||||
git fetch origin ${{ github.event.workflow_run.head_branch }}
|
||||
if ! git diff --quiet origin/${{ github.event.workflow_run.head_branch }}^1 origin/${{ github.event.workflow_run.head_branch }} -- version; then
|
||||
echo "Version file was changed"
|
||||
else
|
||||
echo "Version file was not changed"
|
||||
exit 1
|
||||
|
||||
# Add version check
|
||||
- name: Check if version exists
|
||||
run: |
|
||||
if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
|
||||
echo "::error::Version v${{ steps.version.outputs.version }} already exists"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Generate changelog
|
||||
id: changelog
|
||||
uses: heinrichreimer/github-changelog-generator-action@v2.3
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: v${{ steps.version.outputs.version }}
|
||||
body_path: CHANGELOG.md
|
||||
files: |
|
||||
CHANGELOG.md
|
||||
release/basalt.lua
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in New Issue
Block a user