Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support upload add tag NeoForge #298

Merged
merged 5 commits into from
Aug 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 33 additions & 16 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
Expand All @@ -39,7 +39,7 @@ jobs:
export GIT_COMMIT_DESC=$(git log --format=%B -n 1 $GITHUB_SHA)
./gradlew clean build --stacktrace
-
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
name: Publish to Github Artifact
with:
name: CustomSkinLoader-${{ inputs.type }}-${{ github.run_number }}
Expand All @@ -53,7 +53,7 @@ jobs:
strategy:
matrix:
website: [CurseForge_Modrinth]
modtype: [Fabric,Forge-Active,Forge-Legacy]
modtype: [Fabric,ForgeV1,ForgeV2,ForgeV3]
include:
-
website: ObjectStorage
Expand All @@ -69,9 +69,9 @@ jobs:
steps:
-
name: Checkout Git Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
-
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
name: Download Artifact Zips
with:
path: build
Expand All @@ -86,15 +86,32 @@ jobs:
id: cslenv
run: |
output="$(ls build/libs | grep -v "sources")"
if [[ "${{ matrix.modtype }}" == "Forge"* ]]; then
modloader="Forge"
path=$(echo ${{ matrix.modtype }} | sed "s#-#/#")
else
modloader=${{ matrix.modtype }}
path=${{ matrix.modtype }}
fi

case "${{ matrix.modtype }}" in
"ForgeV1")
modloader="Forge"
path=`echo "${{ matrix.modtype }}" | sed 's#V#/V#'`
;;
"ForgeV2" | "ForgeV3")
modloader=$(cat <<EOF
Forge
NeoForge
EOF
)
path=`echo "${{ matrix.modtype }}" | sed 's#V#/V#'`
;;
"Fabric")
modloader="Fabric"
path="${{ matrix.modtype }}"
;;
*)
echo "Unsupported modtype: ${{ matrix.modtype }}"
exit 1
;;
esac

echo "path=$path" >> $GITHUB_OUTPUT
echo "modloader=$modloader" >> $GITHUB_OUTPUT
echo "modloader="$modloader"" >> $GITHUB_OUTPUT
echo "filename=$(echo "$output"|grep $(echo ${{ matrix.modtype }}|sed "s#-##") )" >> $GITHUB_OUTPUT
echo "version=$(grep "version=" build.properties | grep -v "#" | sed "s/version=//")" >> $GITHUB_OUTPUT
echo "edition=$(echo ${{ matrix.modtype }} | sed "s/-//")" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -134,15 +151,15 @@ jobs:
-
if: ${{ matrix.website == 'GitHub-PreRelease' && startsWith(github.ref, 'refs/heads') }}
name: "[GitHub Pre-Release] Upload Tag"
uses: richardsimko/update-tag@v1.0.7
uses: richardsimko/update-tag@v1
with:
tag_name: CI-Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
if: ${{ matrix.website == 'GitHub-PreRelease' && startsWith(github.ref, 'refs/heads') }}
name: "[GitHub Pre-Release] Publish"
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: CustomSkinLoader CI-Build
Expand Down