Publish #41
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: Publish | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
required: true | |
description: The reference or tag | |
java: | |
required: true | |
description: The build java version | |
jobs: | |
publish: | |
name: Publish Mindustry and Arc | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
path: xpdustry-helper | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ github.event.inputs.java }} | |
distribution: 'temurin' | |
- name: Checkout Mindustry | |
uses: actions/checkout@v4 | |
with: | |
repository: 'Anuken/Mindustry' | |
ref: ${{ github.event.inputs.version }} | |
path: Mindustry | |
- name: Checkout Arc | |
uses: actions/checkout@v4 | |
with: | |
repository: 'Anuken/Arc' | |
ref: ${{ github.event.inputs.version }} | |
path: Arc | |
- name: Install and Setup Minio CLI | |
run: | | |
curl https://dl.min.io/client/mc/release/linux-amd64/mc \ | |
--create-dirs \ | |
-o $HOME/minio-binaries/mc | |
chmod +x $HOME/minio-binaries/mc | |
export PATH=$PATH:$HOME/minio-binaries/ | |
bash +o history | |
mc alias set xpdustry https://minio1.xpdustry.com $MINIO_ACCESS_KEY $MINIO_SECRET_KEY | |
bash -o history | |
for object in $(mc ls -r xpdustry/maven-anuken-releases/ | grep -E 'maven-metadata-local\.xml$' | awk '{print $6}') | |
do | |
mkdir -p ~/.m2/repository/"$(dirname "$object")" | |
mc cp xpdustry/maven-anuken-releases/"$object" ~/.m2/repository/"$object" | |
done | |
env: | |
MINIO_ACCESS_KEY: "${{ secrets.MINIO_ACCESS_KEY }}" | |
MINIO_SECRET_KEY: "${{ secrets.MINIO_SECRET_KEY }}" | |
- name: Build, Test and Install Mindustry and Arc | |
env: | |
VERSION: ${{ github.event.inputs.version }} | |
run: | | |
export JITPACK=true | |
cd ./Arc | |
sed -i "s/group = 'com.github.Anuken'/group = 'com.github.Anuken.Arc'/" build.gradle | |
sed -i "s/version = '1.0'/version = '$VERSION'/" build.gradle | |
./gradlew -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2 -xtest -xjavadoc assemble publishToMavenLocal | |
cd ../Mindustry | |
sed -i "s/group = 'com.github.Anuken'/group = 'com.github.Anuken.Mindustry'/" build.gradle | |
sed -i "s/^archash=.*/archash=$VERSION/" ./gradle.properties | |
./gradlew -PpackageVersion="$VERSION" -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2 -xtest -xjavadoc assemble publishToMavenLocal | |
- name: Upload Updated Artifacts to S3 | |
run: | | |
curl https://dl.min.io/client/mc/release/linux-amd64/mc \ | |
--create-dirs \ | |
-o $HOME/minio-binaries/mc | |
chmod +x $HOME/minio-binaries/mc | |
export PATH=$PATH:$HOME/minio-binaries/ | |
bash +o history | |
mc alias set xpdustry https://minio1.xpdustry.com $MINIO_ACCESS_KEY $MINIO_SECRET_KEY | |
bash -o history | |
# Upload the updated artifacts to S3 | |
mc cp -r ~/.m2/repository/* xpdustry/maven-anuken-releases/ | |
env: | |
MINIO_ACCESS_KEY: "${{ secrets.MINIO_ACCESS_KEY }}" | |
MINIO_SECRET_KEY: "${{ secrets.MINIO_SECRET_KEY }}" |