fix: sponge loads again #8595
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build" | |
on: | |
push: | |
branches: [ "**" ] | |
tags-ignore: [ "**" ] | |
pull_request: | |
workflow_dispatch: | |
merge_group: | |
concurrency: | |
cancel-in-progress: true | |
group: build-${{ github.event.pull_request.number || github.ref }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build and publish | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 23 | |
check-latest: true | |
distribution: 'zulu' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
add-job-summary: always | |
cache-cleanup: on-success | |
cache-read-only: ${{ github.ref != 'refs/heads/nightly' }} | |
- name: Setup Loom cache | |
uses: actions/cache@v4 | |
with: | |
path: '.gradle/loom-cache' | |
restore-keys: ${{ runner.os }}-gradle-loom- | |
key: ${{ runner.os }}-gradle-loom-${{ hashFiles('gradle/libs.versions.toml', 'gradle/wrapper/gradle-wrapper.properties') }} | |
- name: Execute build and tests | |
run: ./gradlew build test shadowJar genUpdaterInformation --stacktrace | |
- name: Publish test summary | |
if: ${{ github.event_name == 'push' && !startsWith(github.ref, 'refs/heads/gh-readonly-queue/') }} | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
with: | |
junit_files: "**/build/test-results/test/TEST-*.xml" | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v8 | |
- name: Publish updater metadata | |
uses: s0/git-publish-subdir-action@develop | |
if: ${{ github.event_name == 'push' && !startsWith(github.ref, 'refs/heads/renovate/') && !startsWith(github.ref, 'refs/heads/gh-readonly-queue/') }} | |
env: | |
REPO: [email protected]:CloudNetService/launchermeta.git | |
BRANCH: ${{ steps.branch-name.outputs.current_branch }} | |
FOLDER: '.launchermeta' | |
SQUASH_HISTORY: true | |
SKIP_EMPTY_COMMITS: true | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
MESSAGE: 'Update launcher meta for {target-branch} (commit: {sha})' | |
- name: Set version type in GitHub environment | |
run: | | |
if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then | |
echo "STATUS=snapshot" >> $GITHUB_ENV | |
else | |
echo "STATUS=release" >> $GITHUB_ENV | |
fi | |
- name: Publish snapshot to Sonatype | |
if: ${{ github.event_name == 'push' && env.STATUS != 'release' && startsWith(github.ref, 'refs/heads/nightly') && !startsWith(github.ref, 'refs/heads/gh-readonly-queue/') }} | |
run: ./gradlew publish | |
env: | |
SONATYPE_USER: "${{ secrets.SONATYPE_USER }}" | |
SONATYPE_TOKEN: "${{ secrets.SONATYPE_TOKEN }}" | |
- name: Prepare artifacts zip | |
if: ${{ github.event_name == 'push' && !startsWith(github.ref, 'refs/heads/gh-readonly-queue/') }} | |
run: | | |
mkdir -p temp/; | |
mkdir -p temp/plugins; | |
cp -r .template/* temp/; | |
cp LICENSE temp/license.txt; | |
cp launcher/java22/build/libs/launcher.jar temp/launcher.jar; | |
find plugins/ -type f -regex '.*/build/libs/.*\.jar' ! -name '*-javadoc.jar' ! -name '*-sources.jar' -exec cp {} temp/plugins \; | |
- name: Upload artifacts zip | |
uses: actions/upload-artifact@v4 | |
if: ${{ github.event_name == 'push' && !startsWith(github.ref, 'refs/heads/gh-readonly-queue/') }} | |
with: | |
name: CloudNet | |
path: temp/ |