Skip to content

Publish Rhino

Publish Rhino #4

Workflow file for this run

name: Publish Rhino
on:
workflow_dispatch:
inputs:
version:
required: true
description: The reference or tag
java:
required: true
description: The build java version
jobs:
publish:
name: Publish Anuken Rhino
runs-on: ubuntu-latest
steps:
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ github.event.inputs.java }}
distribution: 'temurin'
- name: Checkout Anuken Rhino
uses: actions/checkout@v4
with:
repository: 'Anuken/rhino'
ref: ${{ github.event.inputs.version }}
path: rhino
- 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
ls_output=$(mc ls "xpdustry/maven-anuken-releases/com/github/Anuken/rhino/maven-metadata.xml" 2>&1)
exit_code=$?
if [ $exit_code -eq 0 ]; then
if [ -n "$ls_output" ]; then
mkdir -p ~/.m2/repository/com/github/Anuken/rhino
mc cp "xpdustry/maven-anuken-releases/com/github/Anuken/rhino/maven-metadata.xml" "~/.m2/repository/com/github/Anuken/rhino/maven-metadata-local.xml"
else
echo "File does not exist in the bucket"
fi
else
echo "$ls_output"
exit 1
fi
env:
MINIO_ACCESS_KEY: "${{ secrets.MINIO_ACCESS_KEY }}"
MINIO_SECRET_KEY: "${{ secrets.MINIO_SECRET_KEY }}"
- name: Build and Install Rhino
env:
VERSION: ${{ github.event.inputs.version }}
run: |
cd ./rhino
sed -i "s/^version=.*/version=$VERSION/" gradle.properties
./gradlew -Dfile.encoding=UTF-8 -Dhttps.protocols=TLSv1.2 -xtest assemble publishToMavenLocal
find ~/.m2/repository/ -type f -name "maven-metadata-local.xml" -execdir mv {} maven-metadata.xml \;
- 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
find ~/.m2/repository/ -type f -not -name "*.md5" -not -name "*.sha1" -not -name "*.sha256" -not -name "*.sha512" | while read -r file; do
echo "Generating hashes for $file"
md5sum "$file" | awk '{print $1}' > "${file}.md5"
sha1sum "$file" | awk '{print $1}' > "${file}.sha1"
sha256sum "$file" | awk '{print $1}' > "${file}.sha256"
sha512sum "$file" | awk '{print $1}' > "${file}.sha512"
done
# 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 }}"