mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
Fix workflow
* Revert * Cleanup
This commit is contained in:
62
.github/workflows/build-1214.yml
vendored
62
.github/workflows/build-1214.yml
vendored
@@ -1,4 +1,5 @@
|
|||||||
name: Build Leaf 1.21.4
|
name: Build Leaf 1.21.4
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "ver/1.21.4" ]
|
branches: [ "ver/1.21.4" ]
|
||||||
@@ -10,8 +11,6 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
BUILD_NUMBER: ${{ github.run_number }}
|
BUILD_NUMBER: ${{ github.run_number }}
|
||||||
GRADLE_MEMORY: "-Xmx4g -XX:MaxMetaspaceSize=2g"
|
GRADLE_MEMORY: "-Xmx4g -XX:MaxMetaspaceSize=2g"
|
||||||
outputs:
|
|
||||||
build_number: ${{ env.BUILD_NUMBER }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@main
|
uses: actions/checkout@main
|
||||||
@@ -82,16 +81,6 @@ jobs:
|
|||||||
- name: Create MojmapPaperclipJar
|
- name: Create MojmapPaperclipJar
|
||||||
run: ./gradlew createMojmapPaperclipJar --stacktrace --parallel --no-daemon
|
run: ./gradlew createMojmapPaperclipJar --stacktrace --parallel --no-daemon
|
||||||
|
|
||||||
- name: Rename Paperclip JARs
|
|
||||||
run: |
|
|
||||||
mv leaf-server/build/libs/leaf-paperclip-1.21.4-R0.1-SNAPSHOT-mojmap.jar ./leaf-1.21.4-${{ env.BUILD_NUMBER }}-mojmap.jar
|
|
||||||
|
|
||||||
- name: Upload Leaf as build artifact
|
|
||||||
uses: actions/upload-artifact@main
|
|
||||||
with:
|
|
||||||
name: Leaf 1.21.4
|
|
||||||
path: ./leaf-1.21.4-*.jar
|
|
||||||
|
|
||||||
- name: Prepare release notes and artifacts
|
- name: Prepare release notes and artifacts
|
||||||
run: |
|
run: |
|
||||||
chmod +x ./scripts/prepareRelease.sh
|
chmod +x ./scripts/prepareRelease.sh
|
||||||
@@ -101,6 +90,12 @@ jobs:
|
|||||||
GITHUB_REPO: ${{ github.repository }}
|
GITHUB_REPO: ${{ github.repository }}
|
||||||
BUILD_NUMBER: ${{ env.BUILD_NUMBER }}
|
BUILD_NUMBER: ${{ env.BUILD_NUMBER }}
|
||||||
|
|
||||||
|
- name: Upload Leaf
|
||||||
|
uses: actions/upload-artifact@main
|
||||||
|
with:
|
||||||
|
name: Leaf 1.21.4
|
||||||
|
path: ./leaf-1.21.4-${{ env.BUILD_NUMBER }}.jar
|
||||||
|
|
||||||
- name: Release Leaf
|
- name: Release Leaf
|
||||||
uses: softprops/action-gh-release@master
|
uses: softprops/action-gh-release@master
|
||||||
with:
|
with:
|
||||||
@@ -112,3 +107,46 @@ jobs:
|
|||||||
target_commitish: "${{ github.sha }}"
|
target_commitish: "${{ github.sha }}"
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
|
||||||
|
- name: Rename JAR
|
||||||
|
run: mv ./leaf-server/build/libs/leaf-paperclip-1.21.4-R0.1-SNAPSHOT-mojmap.jar ./leaf-1.21.4-${{ env.BUILD_NUMBER }}.jar
|
||||||
|
|
||||||
|
- name: Calculate SHA-256
|
||||||
|
id: hash
|
||||||
|
run: |
|
||||||
|
FILE_NAME="leaf-1.21.4-${{ env.BUILD_NUMBER }}.jar"
|
||||||
|
HASH=$(sha256sum "$FILE_NAME" | awk '{ print $1 }')
|
||||||
|
echo "sha256=$HASH" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Upload JAR to download API
|
||||||
|
uses: appleboy/scp-action@master
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.API_HOST }}
|
||||||
|
username: ${{ secrets.API_USER }}
|
||||||
|
password: ${{ secrets.API_PASS }}
|
||||||
|
source: "./leaf-1.21.4-${{ env.BUILD_NUMBER }}.jar"
|
||||||
|
target: "~/api/uploads/"
|
||||||
|
|
||||||
|
- name: Insert build to download API
|
||||||
|
uses: appleboy/ssh-action@master
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.API_HOST }}
|
||||||
|
username: ${{ secrets.API_USER }}
|
||||||
|
password: ${{ secrets.API_PASS }}
|
||||||
|
script: |
|
||||||
|
BRANCH="${{ github.ref_name }}"
|
||||||
|
REPO_DIR="/root/Leaf-${BRANCH//\//-}" # Replace slashes with dashes to avoid directory issues
|
||||||
|
|
||||||
|
[ -d "$REPO_DIR/.git" ] && cd "$REPO_DIR" && git fetch origin && git checkout "$BRANCH" && git reset --hard "origin/$BRANCH" || git clone --branch "$BRANCH" --depth 1 https://github.com/Winds-Studio/Leaf "$REPO_DIR"
|
||||||
|
|
||||||
|
# Proceed to insert the build into the API
|
||||||
|
cd ~/api/cli
|
||||||
|
node insertBuild.js \
|
||||||
|
--projectName leaf \
|
||||||
|
--projectFriendlyName "Leaf" \
|
||||||
|
--version 1.21.4 \
|
||||||
|
--build-number ${{ env.BUILD_NUMBER }} \
|
||||||
|
--repositoryPath "$REPO_DIR" \
|
||||||
|
--storagePath /root/api/storage \
|
||||||
|
--download "primary:/root/api/uploads/leaf-1.21.4-${{ env.BUILD_NUMBER }}.jar:${{ steps.hash.outputs.sha256 }}" \
|
||||||
|
--buildChannel default
|
||||||
|
|||||||
4
.github/workflows/build-pr.yml
vendored
4
.github/workflows/build-pr.yml
vendored
@@ -34,9 +34,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Rename Paperclip JARs
|
- name: Rename Paperclip JARs
|
||||||
run: |
|
run: |
|
||||||
mv leaf-server/build/libs/leaf-paperclip-1.21.4-R0.1-SNAPSHOT-mojmap.jar ./leaf-1.21.4-mojmap.jar
|
mv leaf-server/build/libs/leaf-paperclip-1.21.4-R0.1-SNAPSHOT-mojmap.jar ./leaf-1.21.4.jar
|
||||||
- name: Upload Leaf as build artifact
|
- name: Upload Leaf as build artifact
|
||||||
uses: actions/upload-artifact@main
|
uses: actions/upload-artifact@main
|
||||||
with:
|
with:
|
||||||
name: Leaf 1.21.4
|
name: Leaf 1.21.4
|
||||||
path: ./leaf-1.21.4-*.jar
|
path: ./leaf-1.21.4.jar
|
||||||
|
|||||||
49
.github/workflows/publish-api.yml
vendored
49
.github/workflows/publish-api.yml
vendored
@@ -1,4 +1,5 @@
|
|||||||
name: Publish API
|
name: Publish API
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "ver/1.21.4" ]
|
branches: [ "ver/1.21.4" ]
|
||||||
@@ -41,10 +42,10 @@ jobs:
|
|||||||
--build-cache \
|
--build-cache \
|
||||||
--no-daemon
|
--no-daemon
|
||||||
|
|
||||||
- name: Build
|
- name: Create MojmapPaperclipJar
|
||||||
run: ./gradlew createMojmapPaperclipJar --stacktrace --parallel --no-daemon
|
run: ./gradlew createMojmapPaperclipJar --stacktrace --parallel --no-daemon
|
||||||
|
|
||||||
- name: Publish API
|
- name: Publish Maven API
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
./gradlew :leaf-api:publish
|
./gradlew :leaf-api:publish
|
||||||
@@ -52,47 +53,3 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
REPO_USER: ${{ secrets.REPO_USER }}
|
REPO_USER: ${{ secrets.REPO_USER }}
|
||||||
REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }}
|
REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }}
|
||||||
|
|
||||||
- name: Calculate SHA-256
|
|
||||||
id: hash
|
|
||||||
run: |
|
|
||||||
FILE_NAME="leaf-1.21.4-${{ env.BUILD_NUMBER }}-mojmap.jar"
|
|
||||||
HASH=$(sha256sum "$FILE_NAME" | awk '{ print $1 }')
|
|
||||||
echo "sha256=$HASH" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Rename JAR
|
|
||||||
run: |
|
|
||||||
mv "leaf-1.21.4-${{ env.BUILD_NUMBER }}-mojmap.jar" "leaf-1.21.4-${{ env.BUILD_NUMBER }}.jar"
|
|
||||||
|
|
||||||
- name: Upload JAR to download API
|
|
||||||
uses: appleboy/scp-action@master
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.API_HOST }}
|
|
||||||
username: ${{ secrets.API_USER }}
|
|
||||||
password: ${{ secrets.API_PASS }}
|
|
||||||
source: "./leaf-1.21.4-${{ env.BUILD_NUMBER }}.jar"
|
|
||||||
target: "~/api/uploads/"
|
|
||||||
|
|
||||||
- name: Insert build to download API
|
|
||||||
uses: appleboy/ssh-action@master
|
|
||||||
with:
|
|
||||||
host: ${{ secrets.API_HOST }}
|
|
||||||
username: ${{ secrets.API_USER }}
|
|
||||||
password: ${{ secrets.API_PASS }}
|
|
||||||
script: |
|
|
||||||
BRANCH="${{ github.ref_name }}"
|
|
||||||
REPO_DIR="/root/Leaf-${BRANCH//\//-}" # Replace slashes with dashes to avoid directory issues
|
|
||||||
|
|
||||||
[ -d "$REPO_DIR/.git" ] && cd "$REPO_DIR" && git fetch origin && git checkout "$BRANCH" && git reset --hard "origin/$BRANCH" || git clone --branch "$BRANCH" --depth 1 https://github.com/Winds-Studio/Leaf "$REPO_DIR"
|
|
||||||
|
|
||||||
# Proceed to insert the build into the API
|
|
||||||
cd ~/api/cli
|
|
||||||
node insertBuild.js \
|
|
||||||
--projectName leaf \
|
|
||||||
--projectFriendlyName "Leaf" \
|
|
||||||
--version 1.21.4 \
|
|
||||||
--build-number ${{ env.BUILD_NUMBER }} \
|
|
||||||
--repositoryPath "$REPO_DIR" \
|
|
||||||
--storagePath /root/api/storage \
|
|
||||||
--download "primary:/root/api/uploads/leaf-1.21.4-${{ env.BUILD_NUMBER }}.jar:${{ steps.hash.outputs.sha256 }}" \
|
|
||||||
--buildChannel default
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ CURRENT_TAG="ver-1.21.4"
|
|||||||
RELEASE_NOTES="release_notes.md"
|
RELEASE_NOTES="release_notes.md"
|
||||||
|
|
||||||
# Rename Leaf jar
|
# Rename Leaf jar
|
||||||
mv ./$JAR_NAME-${BUILD_NUMBER}-mojmap.jar ./$JAR_NAME-${BUILD_NUMBER}.jar
|
mv ./leaf-server/build/libs/leaf-paperclip-1.21.4-R0.1-SNAPSHOT-mojmap.jar ./$JAR_NAME-${BUILD_NUMBER}.jar
|
||||||
|
|
||||||
# Branch name
|
# Branch name
|
||||||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||||
|
|||||||
Reference in New Issue
Block a user