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

55 lines
1.8 KiB
YAML
Raw Normal View History

2024-09-20 11:03:15 +00:00
name: Workflow
2024-09-20 11:23:15 +00:00
run-name: ${{ gitea.actor }} is linting and creating a new release on tag pushes 🚀
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:20:52 +00:00
if: ${{ startsWith(github.ref, 'refs/tags/') }} # only for tags
2024-09-20 01:45:06 +00:00
runs-on: ubuntu-latest
2024-09-20 11:15:06 +00:00
env:
2024-09-20 11:18:02 +00:00
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/.luacheckrc
- name: Set Version and AddonVersion
run: |
2024-09-20 11:18:02 +00:00
echo "Version: ${{ env.Version }}"
export ADDON_VERSION=$(echo ${{ env.Version }} | sed -E 's/(0|)\.//g')
sed -i "s/0.123456789/${{ env.Version }}/g" sources/AchievementInfoCommon.lua
sed -i "s/0.123456789/${{ env.Version }}/g" sources/AchievementInfo.txt
2024-09-20 01:45:06 +00:00
sed -i "s/0.123456789/$ADDON_VERSION/g" sources/AchievementInfo.txt
- name: Rename and zip
run: |
mv sources AchievementInfo
2024-09-20 11:18:02 +00:00
zip -r "AchievementInfo-${{ env.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:18:02 +00:00
name: "AchievementInfo ${{ env.Version }}"
tag_name: "${{ env.Version }}"
2024-09-20 01:45:06 +00:00
body_path: AchievementInfo/CHANGELOG.md
2024-09-20 11:25:52 +00:00
draft: false
2024-09-20 01:45:06 +00:00
prerelease: false
2024-09-20 11:07:51 +00:00
sha256sum: true
2024-09-20 11:03:15 +00:00
files: |-
*.zip