Publish build jar to artifacts branch
All checks were successful
Build / build (push) Successful in 10m37s

This commit is contained in:
Codex
2026-04-26 13:24:05 +02:00
parent c937cbfb10
commit 02a19e9a29

View File

@@ -2,11 +2,14 @@ name: Build
on:
push:
branches:
- "**"
branches-ignore:
- artifacts
pull_request:
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
@@ -27,9 +30,30 @@ jobs:
- name: Build
run: ./gradlew build --no-daemon
- name: Upload mod jar
uses: actions/upload-artifact@v3
with:
name: worldhandler-1.21.1
path: build/libs/*.jar
if-no-files-found: error
- name: Publish jar to artifacts branch
if: github.event_name != 'pull_request'
shell: bash
run: |
set -euo pipefail
mkdir -p /tmp/worldhandler-artifacts
cp build/libs/*.jar /tmp/worldhandler-artifacts/
git config user.name "Gitea Actions"
git config user.email "actions@gitea.local"
git fetch origin artifacts || true
git switch --force-create artifacts
git rm -rf .
cp /tmp/worldhandler-artifacts/*.jar .
cat > README.md <<'EOF'
# WorldHandler build artifacts
This branch is maintained by the Gitea runner.
Download the jar file from this branch.
EOF
git add README.md *.jar
git commit --allow-empty -m "Publish WorldHandler jar from ${GITHUB_SHA}"
git push --force origin artifacts