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: on:
push: push:
branches: branches-ignore:
- "**" - artifacts
pull_request: pull_request:
workflow_dispatch: workflow_dispatch:
permissions:
contents: write
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -27,9 +30,30 @@ jobs:
- name: Build - name: Build
run: ./gradlew build --no-daemon run: ./gradlew build --no-daemon
- name: Upload mod jar - name: Publish jar to artifacts branch
uses: actions/upload-artifact@v3 if: github.event_name != 'pull_request'
with: shell: bash
name: worldhandler-1.21.1 run: |
path: build/libs/*.jar set -euo pipefail
if-no-files-found: error
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