first commit
This commit is contained in:
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
packs/** binary
|
||||||
94
.gitea/workflows/release.yml
Normal file
94
.gitea/workflows/release.yml
Normal file
@@ -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"
|
||||||
16
module.json
Normal file
16
module.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"id": "mm",
|
||||||
|
"title": "Mummy's Mask",
|
||||||
|
"version": "2026-03-26",
|
||||||
|
"compatibility": {
|
||||||
|
"minimum": "13",
|
||||||
|
"verified": "13"
|
||||||
|
},
|
||||||
|
"description": "<p>My cool module for my friend's Mummy Mask game.</p>",
|
||||||
|
"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
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user