From 8830674930aa958a6f3562efd880c6ab1f2d0ce8 Mon Sep 17 00:00:00 2001 From: Florian Brinker Date: Fri, 20 Sep 2024 13:03:15 +0200 Subject: [PATCH] 1 workflow to rule them all --- .gitea/workflows/0_linting.yaml | 12 ------ ...1_build_and_release.yaml => workflow.yaml} | 37 +++++++++---------- 2 files changed, 18 insertions(+), 31 deletions(-) delete mode 100644 .gitea/workflows/0_linting.yaml rename .gitea/workflows/{1_build_and_release.yaml => workflow.yaml} (64%) diff --git a/.gitea/workflows/0_linting.yaml b/.gitea/workflows/0_linting.yaml deleted file mode 100644 index c01ba33..0000000 --- a/.gitea/workflows/0_linting.yaml +++ /dev/null @@ -1,12 +0,0 @@ -name: Linting -run-name: ${{ gitea.actor }} is checking the LUA code 🚀 -on: [push] - -jobs: - Luacheck: - runs-on: ubuntu-latest - steps: - - name: Check out repository code - uses: actions/checkout@v4 - - name: Luacheck linter - uses: lunarmodules/luacheck@v1 \ No newline at end of file diff --git a/.gitea/workflows/1_build_and_release.yaml b/.gitea/workflows/workflow.yaml similarity index 64% rename from .gitea/workflows/1_build_and_release.yaml rename to .gitea/workflows/workflow.yaml index cf2ba9b..0c7d90c 100644 --- a/.gitea/workflows/1_build_and_release.yaml +++ b/.gitea/workflows/workflow.yaml @@ -1,12 +1,19 @@ -name: Build & Release -run-name: ${{ gitea.actor }} is creating a new release 🚀 +name: Workflow +run-name: ${{ gitea.actor }} is lintingn and on tags creating a new release 🚀 on: [push] - #push: - #tags: - # - '*' jobs: - Build: + + 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 @@ -35,21 +42,13 @@ jobs: zip -r "AchievementInfo-$GITHUB_REF_NAME.zip" ./AchievementInfo - name: Create release id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITEATOKEN }} + uses: akkuman/gitea-release-action@v1 with: + token: ${{ secrets.GITEATOKEN }} + name: AchievementInfo $GITHUB_REF_NAME tag_name: $GITHUB_REF_NAME - release_name: AchievementInfo $GITHUB_REF_NAME body_path: AchievementInfo/CHANGELOG.md draft: true prerelease: false - - name: Upload release asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITEATOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./AchievementInfo-$GITHUB_REF_NAME.zip - asset_name: AchievementInfo-$GITHUB_REF_NAME.zip - asset_content_type: application/zip \ No newline at end of file + files: |- + *.zip \ No newline at end of file