elderscrolls-addon-achievem.../.gitea/workflows/workflow.yaml

57 lines
1.7 KiB
YAML
Raw Normal View History

2024-09-20 11:03:15 +00:00
name: Workflow
run-name: ${{ gitea.actor }} is lintingn and on tags creating a new release 🚀
2024-09-20 01:45:06 +00:00
on: [push]
jobs:
2024-09-20 11:03:15 +00:00
Linting:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Run Luacheck linter
uses: lunarmodules/luacheck@v1
2024-09-20 11:07:51 +00:00
Release:
needs: [Linting]
2024-09-20 11:03:15 +00:00
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
2024-09-20 01:45:06 +00:00
runs-on: ubuntu-latest
2024-09-20 11:15:06 +00:00
env:
VERSION: ${{ gitea.ref_name }}
2024-09-20 01:45:06 +00:00
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: |
2024-09-20 11:15:06 +00:00
echo "Version: $VERSION"
export ADDON_VERSION=$(echo $VERSION | sed -E 's/(0|)\.//g')
2024-09-20 01:45:06 +00:00
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
2024-09-20 11:15:06 +00:00
zip -r "AchievementInfo-$VERSION.zip" ./AchievementInfo
2024-09-20 01:45:06 +00:00
- name: Create release
id: create_release
2024-09-20 11:03:15 +00:00
uses: akkuman/gitea-release-action@v1
2024-09-20 01:45:06 +00:00
with:
2024-09-20 11:11:39 +00:00
token: ${{ secrets.token }}
2024-09-20 11:15:06 +00:00
name: "AchievementInfo $VERSION"
tag_name: "$VERSION"
2024-09-20 01:45:06 +00:00
body_path: AchievementInfo/CHANGELOG.md
draft: true
prerelease: false
2024-09-20 11:07:51 +00:00
sha256sum: true
2024-09-20 11:03:15 +00:00
files: |-
*.zip