RELEASE: 5.0.0-alpha.30 #140
Workflow file for this run
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: Create GitHub Pre-Release after GitLab tag mirror | |
on: | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+' | |
- '[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+' | |
- '[0-9]+.[0-9]+.[0-9]+-pre.[0-9]+' | |
jobs: | |
preparations: | |
runs-on: ubuntu-latest | |
# OUTPUTS | |
outputs: | |
version: ${{ steps.tag.outputs.tag }} | |
steps: | |
# GET THE LATEST CODE | |
- name: Checkout latest code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
# EXTRACT TAG FROM PUSH | |
- name: Get tag | |
id: tag | |
uses: tj-actions/[email protected] | |
- name: Use tag | |
run: echo ${{steps.tag.outputs.tag}} | |
jar: | |
needs: preparations | |
runs-on: ubuntu-latest | |
steps: | |
# GET THE LATEST CODE | |
- name: Checkout latest code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
# BUILD PROJECT AND PUBLISH | |
- name: Set up JDK 17 | |
uses: actions/[email protected] | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
check-latest: true | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- uses: gradle/[email protected] | |
with: | |
gradle-version: wrapper | |
- name: Build release | |
env: | |
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
./gradlew -Pversion="${{ needs.preparations.outputs.version }}" generateLicenseReport --info --full-stacktrace | |
./gradlew -Pversion="${{ needs.preparations.outputs.version }}" build --info --full-stacktrace -x :serverpackcreator-api:jvmTest -x :serverpackcreator-web:test | |
# UPLOAD ARTIFACTS | |
- uses: actions/[email protected] | |
if: ${{ always() }} | |
with: | |
name: build-artifacts | |
path: | | |
serverpackcreator-api/build | |
serverpackcreator-app/build | |
serverpackcreator-cli/build | |
serverpackcreator-gui/build | |
serverpackcreator-updater/build | |
serverpackcreator-web/build | |
serverpackcreator-web-frontend/dist | |
serverpackcreator-plugin-example/build | |
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn` | |
- name: Rename JAR and Plugin | |
run: | | |
mv serverpackcreator-app/build/libs/serverpackcreator-app-${{ needs.preparations.outputs.version }}.jar serverpackcreator-app/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}.jar | |
mv serverpackcreator-plugin-example/build/libs/serverpackcreator-plugin-example-${{ needs.preparations.outputs.version }}.jar serverpackcreator-plugin-example/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}-Example-Plugin.jar | |
# UPLOAD ARTIFACTS | |
- uses: actions/[email protected] | |
if: ${{ always() }} | |
with: | |
name: release-artifacts | |
path: | | |
serverpackcreator-app/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}.jar | |
serverpackcreator-plugin-example/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}-Example-Plugin.jar | |
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn` | |
mac-01: | |
runs-on: macos-latest | |
needs: preparations | |
steps: | |
# GET THE LATEST CODE | |
- name: Checkout latest code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
# BUILD PROJECT AND PUBLISH | |
- name: Set up JDK 17 | |
uses: actions/[email protected] | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
check-latest: true | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- uses: gradle/[email protected] | |
with: | |
gradle-version: wrapper | |
- name: Build installer | |
env: | |
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
./gradlew -Pversion="${{ needs.preparations.outputs.version }}" generateLicenseReport --info --full-stacktrace | |
./gradlew :serverpackcreator-app:jpackage -Pversion="${{ needs.preparations.outputs.version }}" --info --full-stacktrace -x :serverpackcreator-api:jvmTest -x :serverpackcreator-web:test | |
- name: List After Build | |
run: ls serverpackcreator-app/build/dist/ | |
- name: Rename MacOs | |
run: mv serverpackcreator-app/build/dist/ServerPackCreator*.pkg serverpackcreator-app/build/dist/ServerPackCreator-${{ needs.preparations.outputs.version }}-Installer-MacOS.pkg | |
- name: Artifacts | |
uses: actions/[email protected] | |
if: ${{ always() }} | |
with: | |
name: release-artifacts | |
path: | | |
serverpackcreator-app/build/dist/ServerPackCreator-${{ needs.preparations.outputs.version }}-Installer-MacOS.pkg | |
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn` | |
- name: Upload | |
uses: actions/[email protected] | |
if: ${{ always() }} | |
with: | |
name: mac-installer-artifacts | |
path: | | |
serverpackcreator-app/build | |
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn` | |
windows-01: | |
runs-on: windows-latest | |
needs: preparations | |
steps: | |
# GET THE LATEST CODE | |
- name: Checkout latest code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
# BUILD PROJECT AND PUBLISH | |
- name: Set up JDK 17 | |
uses: actions/[email protected] | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
check-latest: true | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- uses: gradle/[email protected] | |
with: | |
gradle-version: wrapper | |
- name: Prepare wix-toolset | |
run: echo "${env:path};${env:wix}bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 | |
- name: Build installer | |
env: | |
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
./gradlew -Pversion="${{ needs.preparations.outputs.version }}" generateLicenseReport --info --full-stacktrace | |
./gradlew :serverpackcreator-app:jpackage -Pversion="${{ needs.preparations.outputs.version }}" --info --full-stacktrace -x :serverpackcreator-api:jvmTest -x :serverpackcreator-web:test | |
- name: List After Build | |
run: ls serverpackcreator-app/build/dist/ | |
- name: Rename Windows | |
run: mv serverpackcreator-app/build/dist/ServerPackCreator*.msi serverpackcreator-app/build/dist/ServerPackCreator-${{ needs.preparations.outputs.version }}-Installer-Windows.msi | |
- name: Artifacts | |
uses: actions/[email protected] | |
if: ${{ always() }} | |
with: | |
name: release-artifacts | |
path: | | |
serverpackcreator-app/build/dist/ServerPackCreator-${{ needs.preparations.outputs.version }}-Installer-Windows.msi | |
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn` | |
- name: Upload | |
uses: actions/[email protected] | |
if: ${{ always() }} | |
with: | |
name: windows-installer-artifacts | |
path: | | |
serverpackcreator-app/build | |
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn` | |
windows-02: | |
runs-on: windows-latest | |
needs: preparations | |
steps: | |
# GET THE LATEST CODE | |
- name: Checkout latest code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
# BUILD PROJECT AND PUBLISH | |
- name: Set up JDK 17 | |
id: java | |
uses: actions/[email protected] | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
check-latest: true | |
cache: 'gradle' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- uses: gradle/[email protected] | |
with: | |
gradle-version: wrapper | |
- name: Prepare wix-toolset | |
run: echo "${env:path};${env:wix}bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 | |
- name: Prepare | |
env: | |
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
./gradlew -Pversion="${{ needs.preparations.outputs.version }}" generateLicenseReport --info --full-stacktrace | |
./gradlew -Pversion="${{ needs.preparations.outputs.version }}" :serverpackcreator-app:build :serverpackcreator-app:copyDependencies :serverpackcreator-app:copyJar :serverpackcreator-app:cleanTmpPackager --info --full-stacktrace | |
- name: Build Image | |
run: | | |
$Version = "${{ needs.preparations.outputs.version }}".split("-") | |
jpackage ` | |
--app-version $Version[0] ` | |
--copyright "Copyright (C) 2023 Griefed" ` | |
--description "Create server packs from Minecraft Forge, Fabric, Quilt or LegacyFabric modpacks." ` | |
--dest "serverpackcreator-app\build\dist" ` | |
--icon "serverpackcreator-app\jpackagerResources\app.ico" ` | |
--input "serverpackcreator-app\build\jars" ` | |
--java-options "-Dfile.encoding=UTF-8" ` | |
--java-options "-Dlog4j2.formatMsgNoLookups=true" ` | |
--main-class de.griefed.serverpackcreator.app.ServerPackCreatorKt ` | |
--main-jar serverpackcreator-app-${{ needs.preparations.outputs.version }}-plain.jar ` | |
--name ServerPackCreator ` | |
--resource-dir "serverpackcreator-app\jpackagerResources" ` | |
--runtime-image "${{ steps.java.outputs.path }}" ` | |
--temp "serverpackcreator-app\build\tmp\jpackager" ` | |
--type "app-image" ` | |
--vendor "griefed.de" ` | |
--verbose | |
- name: List | |
run: dir serverpackcreator-app\build\dist | |
- name: Archive | |
uses: thedoctor0/[email protected] | |
with: | |
type: 'zip' | |
directory: serverpackcreator-app/build/dist | |
path: 'ServerPackCreator' | |
filename: 'ServerPackCreator-Portable-Windows.zip' | |
- name: Rename Archive | |
run: mv serverpackcreator-app/build/dist/ServerPackCreator-Portable-Windows.zip serverpackcreator-app/build/dist/ServerPackCreator-${{ needs.preparations.outputs.version }}-Portable-Windows.zip | |
- name: List | |
run: dir serverpackcreator-app\build\dist | |
- name: Artifacts | |
uses: actions/[email protected] | |
if: ${{ always() }} | |
with: | |
name: release-artifacts | |
path: | | |
serverpackcreator-app/build/dist/ServerPackCreator-${{ needs.preparations.outputs.version }}-Portable-Windows.zip | |
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn` | |
# UPLOAD OS-SPECIFICS | |
- name: Upload | |
uses: actions/[email protected] | |
if: ${{ always() }} | |
with: | |
name: windows-installer-artifacts | |
path: | | |
serverpackcreator-app/build | |
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn` | |
ubuntu-01: | |
runs-on: ubuntu-latest | |
needs: preparations | |
steps: | |
# GET THE LATEST CODE | |
- name: Checkout latest code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
# BUILD PROJECT AND PUBLISH | |
- name: Set up JDK 17 | |
uses: actions/[email protected] | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
check-latest: true | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- uses: gradle/[email protected] | |
with: | |
gradle-version: wrapper | |
- name: Build installer | |
env: | |
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
./gradlew -Pversion="${{ needs.preparations.outputs.version }}" generateLicenseReport --info --full-stacktrace | |
./gradlew :serverpackcreator-app:jpackage -Pversion="${{ needs.preparations.outputs.version }}" --info --full-stacktrace -x :serverpackcreator-api:jvmTest -x :serverpackcreator-web:test | |
- name: List After Build | |
run: ls serverpackcreator-app/build/dist/ | |
- name: Rename | |
run: mv serverpackcreator-app/build/dist/serverpackcreator*.deb serverpackcreator-app/build/dist/ServerPackCreator-${{ needs.preparations.outputs.version }}-Installer-Ubuntu-amd64.deb | |
- name: Artifacts | |
uses: actions/[email protected] | |
if: ${{ always() }} | |
with: | |
name: release-artifacts | |
path: | | |
serverpackcreator-app/build/dist/ServerPackCreator-${{ needs.preparations.outputs.version }}-Installer-Ubuntu-amd64.deb | |
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn` | |
- name: Upload | |
uses: actions/[email protected] | |
if: ${{ always() }} | |
with: | |
name: ubuntu-installer-artifacts | |
path: | | |
serverpackcreator-app/build | |
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn` | |
ubuntu-02: | |
runs-on: ubuntu-latest | |
needs: preparations | |
steps: | |
# GET THE LATEST CODE | |
- name: Checkout latest code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
# BUILD PROJECT AND PUBLISH | |
- name: Set up JDK 17 | |
id: java | |
uses: actions/[email protected] | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
check-latest: true | |
cache: 'gradle' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- uses: gradle/[email protected] | |
with: | |
gradle-version: wrapper | |
- name: Prepare | |
env: | |
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
./gradlew -Pversion="${{ needs.preparations.outputs.version }}" generateLicenseReport --info --full-stacktrace | |
./gradlew -Pversion="${{ needs.preparations.outputs.version }}" :serverpackcreator-app:build :serverpackcreator-app:copyDependencies :serverpackcreator-app:copyJar :serverpackcreator-app:cleanTmpPackager --info --full-stacktrace | |
- name: Build Image | |
run: | | |
IFS="-" read -ra VERSION <<<"${{ needs.preparations.outputs.version }}" | |
jpackage \ | |
--app-version "${VERSION[0]}" \ | |
--copyright "Copyright (C) 2023 Griefed" \ | |
--description "Create server packs from Minecraft Forge, Fabric, Quilt or LegacyFabric modpacks." \ | |
--dest serverpackcreator-app/build/dist \ | |
--icon serverpackcreator-app/jpackagerResources/app.png \ | |
--input serverpackcreator-app/build/jars \ | |
--java-options "-Dfile.encoding=UTF-8" \ | |
--java-options "-Dlog4j2.formatMsgNoLookups=true" \ | |
--main-class de.griefed.serverpackcreator.app.ServerPackCreatorKt \ | |
--main-jar serverpackcreator-app-${{ needs.preparations.outputs.version }}-plain.jar \ | |
--name ServerPackCreator \ | |
--resource-dir serverpackcreator-app/jpackagerResources \ | |
--runtime-image ${{ steps.java.outputs.path }} \ | |
--temp serverpackcreator-app/build/tmp/jpackager \ | |
--type "app-image" \ | |
--vendor "griefed.de" \ | |
--verbose | |
- name: List | |
run: ls -ahl serverpackcreator-app/build/dist | |
- name: Create AppImage | |
run: | | |
mkdir -p serverpackcreator-app/build/dist/ServerPackCreator.AppDir/usr/share/applications && \ | |
mkdir -p serverpackcreator-app/build/dist/ServerPackCreator.AppDir/usr/icons/hicolor/512x512 && \ | |
mkdir -p serverpackcreator-app/build/dist/ServerPackCreator.AppDir/usr/icons/hicolor/scalable && \ | |
cp -rf serverpackcreator-app/build/dist/ServerPackCreator/* \ | |
serverpackcreator-app/build/dist/ServerPackCreator.AppDir && \ | |
cp serverpackcreator-app/jpackagerResources/ServerPackCreator.desktop \ | |
serverpackcreator-app/build/dist/ServerPackCreator.AppDir/usr/share/applications/ServerPackCreator.desktop && \ | |
cp serverpackcreator-app/jpackagerResources/serverpackcreator.png \ | |
serverpackcreator-app/build/dist/ServerPackCreator.AppDir/usr/icons/hicolor/512x512/ServerPackCreator.png && \ | |
cp serverpackcreator-app/jpackagerResources/serverpackcreator.svg \ | |
serverpackcreator-app/build/dist/ServerPackCreator.AppDir/usr/icons/hicolor/scalable/ServerPackCreator.svg && \ | |
cd serverpackcreator-app/build/dist/ServerPackCreator.AppDir && \ | |
ln -s bin/ServerPackCreator \ | |
AppRun && \ | |
ln -s usr/share/applications/ServerPackCreator.desktop \ | |
ServerPackCreator.desktop && \ | |
ln -s usr/icons/hicolor/512x512/ServerPackCreator.png \ | |
ServerPackCreator.png && \ | |
ln -s usr/icons/hicolor/scalable/ServerPackCreator.svg \ | |
ServerPackCreator.svg && \ | |
cd .. && \ | |
curl \ | |
-L https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage \ | |
-o appimagetool.AppImage && \ | |
chmod +x appimagetool.AppImage && \ | |
./appimagetool.AppImage --appimage-extract && \ | |
export PATH=./squashfs-root/usr/bin:${PATH} && \ | |
appimagetool \ | |
ServerPackCreator.AppDir \ | |
ServerPackCreator-${{ needs.preparations.outputs.version }}-Portable-Linux-x86_64.AppImage | |
- name: Artifacts | |
uses: actions/[email protected] | |
if: ${{ always() }} | |
with: | |
name: release-artifacts | |
path: | | |
serverpackcreator-app/build/dist/ServerPackCreator-${{ needs.preparations.outputs.version }}-Portable-Linux-x86_64.AppImage | |
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn` | |
# UPLOAD OS-SPECIFICS | |
- name: Upload | |
uses: actions/[email protected] | |
if: ${{ always() }} | |
with: | |
name: ubuntu-installer-artifacts | |
path: | | |
serverpackcreator-app/build | |
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn` | |
prerelease: | |
runs-on: ubuntu-latest | |
needs: [preparations, jar, mac-01, windows-01, windows-02, ubuntu-01, ubuntu-02] | |
steps: | |
# GET THE LATEST CODE | |
- name: Checkout latest code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
# GET RELEASE INFO | |
- name: Get Release Info | |
run: | | |
curl --header \ | |
'PRIVATE-TOKEN: ${{ secrets.GITLAB_TOKEN }}' \ | |
'https://git.griefed.de/api/v4/projects/63/releases/${{ needs.preparations.outputs.version }}' >> version.json | |
# GET DESCRIPTION | |
- name: Extract version changelog | |
uses: sergeysova/[email protected] | |
id: description | |
with: | |
cmd: "jq .description version.json -r | sed -e 's/\\n/\\n/g' > description.txt && echo \"\n\n---\n\n### Note\n\n#### Alphas\n\nAlphas are feature-incomplete and very likely to have bugs. Before submitting an issue, please check the corresponding [milestone](https://git.griefed.de/Griefed/ServerPackCreator/-/milestones) of this releases major version to see whether an issue for yours already exists there.\nDoing so saves both you and me a lot of time. Thanks in advance!\n\n#### Betas\n\nBetas are feature-complete and probably have bugs.\n\n#### Installers\n\nWhen using pre-release installers, please uninstall previous versions of ServerPackCreator before installing a newer one.\" | sed -e 's/\\n/\\n/g' >> description.txt" | |
multiline: true | |
- name: General Info | |
id: info | |
uses: jaywcjlove/github-action-read-file@main | |
with: | |
path: misc/INFO.md | |
- name: Dafuq # Otherwise we wouldn't be able to work with the file. Because reasons... | |
run: sudo chown $USER description.txt | |
- name: Check length and truncate if needed | |
run: | | |
if [[ $(wc -c description.txt | awk '{print $1}') -ge 8000 ]]; then | |
truncate -s 8000 description.txt | |
printf "\n\n............\n\nRelease notes truncated. For more details, see the [CHANGELOG](https://github.com/Griefed/ServerPackCreator/blob/main/CHANGELOG.md).\n\n" >> description.txt | |
fi | |
- name: Append Release Info | |
uses: "DamianReeves/write-file-action@master" | |
with: | |
path: description.txt | |
write-mode: append | |
contents: | | |
${{ steps.preinfo.outputs.content }} | |
${{ steps.info.outputs.content }} | |
- uses: actions/[email protected] | |
with: | |
name: release-artifacts | |
# GENERATE RELEASE | |
- name: Create Release | |
id: create_release | |
uses: softprops/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag_name: ${{ needs.preparations.outputs.version }} | |
name: Pre-Release ${{ needs.preparations.outputs.version }} | |
body_path: description.txt | |
draft: false | |
prerelease: true | |
fail_on_unmatched_files: false | |
files: | | |
ServerPackCreator-${{ needs.preparations.outputs.version }}-Installer-MacOS.pkg | |
ServerPackCreator-${{ needs.preparations.outputs.version }}-Installer-Windows.msi | |
ServerPackCreator-${{ needs.preparations.outputs.version }}-Installer-Ubuntu-amd64.deb | |
ServerPackCreator-${{ needs.preparations.outputs.version }}-Portable-Windows.zip | |
ServerPackCreator-${{ needs.preparations.outputs.version }}-Portable-Linux-x86_64.AppImage | |
serverpackcreator-app/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}.jar | |
serverpackcreator-plugin-example/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}-Example-Plugin.jar |