8 Commits

Author SHA1 Message Date
95deda1f59 v1.0.0
All checks were successful
Release / release (push) Successful in 3s
2026-03-08 23:56:50 +00:00
3f3d1e1e5d Ensure all tags are fetched when checking out the repo
All checks were successful
Release / release (push) Successful in 3s
2026-03-08 23:55:19 +00:00
877b8e9a04 Update release workflow
Some checks failed
Release / release (push) Failing after 2s
2026-03-08 23:52:05 +00:00
4ce59f537c Trigger workflow one more time
Some checks failed
Release / release (push) Failing after 3s
2026-03-08 23:44:02 +00:00
7d13bde13b Trigger workflow 2026-03-08 23:40:18 +00:00
3aa792a620 Add release workflow 2026-03-08 23:34:09 +00:00
c0b667847c Update package script 2026-03-08 23:33:59 +00:00
ce2956f072 Update package script 2026-03-08 23:14:16 +00:00
2 changed files with 86 additions and 3 deletions

View File

@@ -0,0 +1,81 @@
name: Release
on:
push:
branches:
- main # or your default branch
jobs:
release:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch full history
tags: true # fetch all tags
- name: Check/Create Tag
id: tag
run: |
VERSION=$(cat VERSION | tr -d '[:space:]') # read version and trim whitespace
echo "Version: $VERSION"
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
echo "Tag v$VERSION already exists. Skipping release."
exit 0
fi
# Tag does not exist → create it
echo "Creating tag v$VERSION"
git tag "v$VERSION"
git push origin "v$VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Build Artifacts
if: steps.tag.outputs.version
run: |
chmod +x ./package
./package
ls -l dist/
- name: Create Release
if: steps.tag.outputs.version
id: create_release
run: |
VERSION="${{ steps.tag.outputs.version }}"
RESPONSE=$(curl -s -X POST \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-H "Content-Type: application/json" \
"https://git.thewizardapprentice.com/api/v1/repos/${{ gitea.repository }}/releases" \
-d '{
"tag_name": "v'"$VERSION"'",
"name": "wapp-v'"$VERSION"'",
"body": "Automated release for wapp-v'"$VERSION"'",
"draft": false,
"prerelease": false
}')
echo "$RESPONSE"
RELEASE_ID=$(echo $RESPONSE | jq -r '.id')
echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT
- name: Upload Artifacts
if: steps.tag.outputs.version
run: |
RELEASE_ID="${{ steps.create_release.outputs.release_id }}"
for FILE in dist/*; do
FILENAME=$(basename "$FILE")
echo "Uploading $FILENAME"
curl -X POST \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-H "Content-Type: application/octet-stream" \
--data-binary @"$FILE" \
"https://git.thewizardapprentice.com/api/v1/repos/${{ gitea.repository }}/releases/$RELEASE_ID/assets?name=$FILENAME"
done
- name: Cleanup
if: steps.tag.outputs.version
run: rm -rf dist/*

View File

@@ -2,8 +2,10 @@
cp -r src wapp
ARCHIVE_NAME="wapp-$(cat VERSION)"
tar -czvf $ARCHIVE_NAME.tar.gz wapp
zip -r $ARCHIVE_NAME.zip wapp
mkdir -p dist
ARCHIVE_NAME="wapp-v$(cat VERSION)"
tar -czvf dist/$ARCHIVE_NAME.tar.gz wapp
zip -r dist/$ARCHIVE_NAME.zip wapp
rm -rf wapp