release automation: gitea actions build every push and publish tagged releases (version from the tag, packages, sha256sums, changelog section as text), simple 5-step install guide in the readme
This commit is contained in:
1 parent
f5fd411592
commit
a64df88c77
7 files changed
+262
-9
No files matched your search
@@ -0,0 +1,25 @@
|
||||
# Builds and tests every push and pull request (tests that need the game CD skip themselves).
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ['**']
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: |
|
||||
25
|
||||
21
|
||||
- name: Build and test
|
||||
run: |
|
||||
./gradlew --no-daemon \
|
||||
-Porg.gradle.java.installations.fromEnv=JAVA_HOME_25_X64 \
|
||||
-Porg.gradle.java.installations.auto-download=false \
|
||||
build
|
||||
@@ -0,0 +1,61 @@
|
||||
# Builds and publishes a release when a version tag is pushed:
|
||||
# git tag v0.2.1 && git push origin v0.2.1
|
||||
# The release gets the four packages (full/launcher x Windows/Linux), SHA256SUMS.txt and the
|
||||
# matching CHANGELOG.md section as its text. Tests that need the game CD skip themselves here.
|
||||
#
|
||||
# Needs: Gitea Actions enabled and a runner with the label "ubuntu-latest" (act_runner).
|
||||
# The built-in token is used; if it may not create releases on your instance, add a repository
|
||||
# secret RELEASE_TOKEN (a token with write access to the repository).
|
||||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: JDK 25 (toolchain) and 21 (runs Gradle)
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: |
|
||||
25
|
||||
21
|
||||
|
||||
- name: Version from the tag
|
||||
run: |
|
||||
V="${GITHUB_REF_NAME#v}"
|
||||
echo "VERSION=$V" >> "$GITHUB_ENV"
|
||||
python3 tools/release/changelog_section.py "$V" > release-notes.md
|
||||
echo "Release $V"; head -5 release-notes.md
|
||||
|
||||
- name: Build, test and package
|
||||
run: |
|
||||
./gradlew --no-daemon \
|
||||
-Porg.gradle.java.installations.fromEnv=JAVA_HOME_25_X64 \
|
||||
-Porg.gradle.java.installations.auto-download=false \
|
||||
-PreleaseVersion="$VERSION" \
|
||||
build packageAll
|
||||
|
||||
- name: Checksums
|
||||
run: |
|
||||
cd build/dist
|
||||
ls -la
|
||||
sha256sum LlamaMod-"$VERSION"-*.zip LlamaMod-"$VERSION"-*.tar.gz > SHA256SUMS.txt
|
||||
cat SHA256SUMS.txt
|
||||
|
||||
- name: Publish
|
||||
env:
|
||||
GITEA_URL: ${{ github.server_url }}
|
||||
GITEA_REPO: ${{ github.repository }}
|
||||
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN || github.token }}
|
||||
run: |
|
||||
python3 tools/release/publish_gitea.py \
|
||||
--tag "$GITHUB_REF_NAME" --title "LlamaMod $VERSION" --notes release-notes.md \
|
||||
build/dist/LlamaMod-"$VERSION"-*.zip build/dist/LlamaMod-"$VERSION"-*.tar.gz \
|
||||
build/dist/SHA256SUMS.txt
|
||||
Reference in new issue
Block a user