Skip to content

Commit

Permalink
support upload add tag NeoForge (#298)
Browse files Browse the repository at this point in the history
* Update common.yml

* Update common.yml

* Update common.yml

* Update common.yml

* Update common.yml
  • Loading branch information
8MiYile authored Aug 10, 2024
1 parent 3e4b06f commit 23f08a3
Showing 1 changed file with 33 additions and 16 deletions.
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

0 comments on commit 23f08a3

Please sign in to comment.