From a517ebb7ccd048dc179094af5e302b53c9b48092 Mon Sep 17 00:00:00 2001 From: Kevin Robert Andrews Date: Tue, 31 Mar 2026 18:21:02 -0400 Subject: [PATCH] first commit --- .gitattributes | 1 + .gitea/workflows/release.yml | 94 ++++++++++++++++++++++++++++++++++++ README.md | 3 ++ module.json | 16 ++++++ 4 files changed, 114 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitea/workflows/release.yml create mode 100644 README.md create mode 100644 module.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..4ee706a --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +packs/** binary diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..b1c2752 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,94 @@ +name: Release + +on: + push: + tags: + - 'v*' + +env: + GITEA_HOST: git.kappow.ca + REPO: kevin/mm + MODULE_ID: mm + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set version from tag + id: vars + run: | + TAG="${GITHUB_REF_NAME}" + VERSION="${TAG#v}" + echo "TAG=$TAG" >> $GITHUB_OUTPUT + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + + - name: Update module.json version and download URL + run: | + jq \ + --arg version "${{ steps.vars.outputs.VERSION }}" \ + --arg download "https://${{ env.GITEA_HOST }}/${{ env.REPO }}/releases/download/${{ steps.vars.outputs.TAG }}/${{ env.MODULE_ID }}.zip" \ + '.version = $version | .download = $download' \ + module.json > /tmp/module.json + mv /tmp/module.json module.json + + - name: Commit updated module.json back to main + run: | + git config user.name "Gitea Actions" + git config user.email "actions@${{ env.GITEA_HOST }}" + git fetch origin main + git checkout main + # Re-apply the version bump on main + jq \ + --arg version "${{ steps.vars.outputs.VERSION }}" \ + --arg download "https://${{ env.GITEA_HOST }}/${{ env.REPO }}/releases/download/${{ steps.vars.outputs.TAG }}/${{ env.MODULE_ID }}.zip" \ + '.version = $version | .download = $download' \ + module.json > /tmp/module.json + mv /tmp/module.json module.json + git add module.json + git diff --cached --quiet || git commit -m "chore: release ${{ steps.vars.outputs.TAG }}" + git push "https://actions:${{ secrets.GITEA_TOKEN }}@${{ env.GITEA_HOST }}/${{ env.REPO }}.git" main + git checkout ${{ steps.vars.outputs.TAG }} + + - name: Create module zip + run: | + # Re-apply module.json changes (we're back on the tag commit) + jq \ + --arg version "${{ steps.vars.outputs.VERSION }}" \ + --arg download "https://${{ env.GITEA_HOST }}/${{ env.REPO }}/releases/download/${{ steps.vars.outputs.TAG }}/${{ env.MODULE_ID }}.zip" \ + '.version = $version | .download = $download' \ + module.json > /tmp/module.json + mv /tmp/module.json module.json + zip -r ${{ env.MODULE_ID }}.zip . \ + --exclude ".git/*" \ + --exclude ".gitea/*" \ + --exclude "*.zip" + + - name: Create Gitea release + id: create_release + run: | + RESPONSE=$(curl -s -X POST \ + -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ + -H "Content-Type: application/json" \ + -d "{ + \"tag_name\": \"${{ steps.vars.outputs.TAG }}\", + \"name\": \"${{ steps.vars.outputs.TAG }}\", + \"body\": \"Release ${{ steps.vars.outputs.TAG }}\" + }" \ + "https://${{ env.GITEA_HOST }}/api/v1/repos/${{ env.REPO }}/releases") + echo "RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')" >> $GITHUB_OUTPUT + + - name: Upload module zip + run: | + curl -s -X POST \ + -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ + -F "attachment=@${{ env.MODULE_ID }}.zip" \ + "https://${{ env.GITEA_HOST }}/api/v1/repos/${{ env.REPO }}/releases/${{ steps.create_release.outputs.RELEASE_ID }}/assets" + + - name: Upload module.json + run: | + curl -s -X POST \ + -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ + -F "attachment=@module.json" \ + "https://${{ env.GITEA_HOST }}/api/v1/repos/${{ env.REPO }}/releases/${{ steps.create_release.outputs.RELEASE_ID }}/assets" \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..18aa0ae --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# mm + +My cool module for Mummy's Mask. \ No newline at end of file diff --git a/module.json b/module.json new file mode 100644 index 0000000..d1d65d8 --- /dev/null +++ b/module.json @@ -0,0 +1,16 @@ +{ + "id": "mm", + "title": "Mummy's Mask", + "version": "2026-03-26", + "compatibility": { + "minimum": "13", + "verified": "13" + }, + "description": "

My cool module for my friend's Mummy Mask game.

", + "url": "https://git.kappow.ca/kevin/mm", + "manifest": "https://git.kappow.ca/kevin/mm/raw/branch/main/module.json", + "download": "https://git.kappow.ca/kevin/mm/releases/download/latest/mm.zip", + "flags": { + "canUpload": true + } +} \ No newline at end of file