54 line
1.7 KiB
YAML
54 line
1.7 KiB
YAML
name: Workflow
|
|
run-name: ${{ gitea.actor }} is lintingn and on tags creating a new release 🚀
|
|
on: [push]
|
|
|
|
jobs:
|
|
|
|
Linting:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4
|
|
- name: Run Luacheck linter
|
|
uses: lunarmodules/luacheck@v1
|
|
|
|
Deployment:
|
|
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
path: sources
|
|
- name: Delete unneeded files/dirs
|
|
run: |
|
|
rm -rf sources/.git
|
|
rm -rf sources/.gitea
|
|
rm -rf sources/screenshots
|
|
rm -f sources/.drone.status
|
|
rm -f sources/.drone.yml
|
|
rm -f sources/.luacheckrc
|
|
- name: Set Version and AddonVersion
|
|
run: |
|
|
echo "Version: $GITHUB_REF_NAME"
|
|
export VERSION=$GITHUB_REF_NAME
|
|
export ADDON_VERSION=$(echo $GITHUB_REF_NAME | sed -E 's/(0|)\.//g')
|
|
sed -i "s/0.123456789/$VERSION/g" sources/AchievementInfoCommon.lua
|
|
sed -i "s/0.123456789/$VERSION/g" sources/AchievementInfo.txt
|
|
sed -i "s/0.123456789/$ADDON_VERSION/g" sources/AchievementInfo.txt
|
|
- name: Rename and zip
|
|
run: |
|
|
mv sources AchievementInfo
|
|
zip -r "AchievementInfo-$GITHUB_REF_NAME.zip" ./AchievementInfo
|
|
- name: Create release
|
|
id: create_release
|
|
uses: akkuman/gitea-release-action@v1
|
|
with:
|
|
token: ${{ secrets.GITEATOKEN }}
|
|
name: AchievementInfo $GITHUB_REF_NAME
|
|
tag_name: $GITHUB_REF_NAME
|
|
body_path: AchievementInfo/CHANGELOG.md
|
|
draft: true
|
|
prerelease: false
|
|
files: |-
|
|
*.zip |