Skip to content

Commit

Permalink
Add Release
Browse files Browse the repository at this point in the history
Update workflows
  • Loading branch information
LittleChest committed Apr 19, 2024
1 parent a62a913 commit b65abca
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI
on:
push:
branches: [ dev ]
workflow_dispatch:

jobs:
Expand All @@ -9,13 +10,16 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Get latest release version
id: latest-release
uses: fangqiuming/[email protected]

- name: Replace version
run: |
sed -i "s/_VERSION_/$(git rev-parse --short "$GITHUB_SHA")/g" pack.toml
echo "VERSION=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
sed -i "s/_VERSION_/0.0.0/g" config/fabric_loader_dependencies.json
find config -type f -exec sed -i "s/_VERSION_/$(git rev-parse --short "$GITHUB_SHA")/g" {} +
find config -type f -exec sed -i "s/_COMMIT_/${{ github.sha }}/g" {} +
echo "VERSION=${{ steps.latest-release.outputs.tag_name }}-$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
sed -i "s/_VERSION_/${{ steps.latest-release.outputs.tag_name }}/g" config/fabric_loader_dependencies.json
find . -type f -exec sed -i "s/_VERSION_/${{ steps.latest-release.outputs.tag_name }}-$(git rev-parse --short "$GITHUB_SHA")/g" {} +
find . -type f -exec sed -i "s/_COMMIT_/${{ github.sha }}/g" {} +
- name: Install Packwiz
run: |
Expand Down Expand Up @@ -83,4 +87,4 @@ jobs:
java -jar cmcl.jar config printStartupInfo true
java -jar cmcl.jar config checkAccountBeforeStart false
echo "0" | java -jar cmcl.jar CI
if [ `grep -c "java.lang.IllegalStateException: Failed to initialize GLFW, errors: GLFW error during init: [0x1000E]Failed to detect any supported platform" .minecraft/versions/CI/latest.log` -ne "0" ]; then echo "::error title=Game crashed::Oops." && exit 1; fi
if [ `grep -c "java.lang.IllegalStateException: Failed to initialize GLFW, errors: GLFW error during init: [0x1000E]Failed to detect any supported platform" .minecraft/versions/CI/logs/latest.log` -ne "1" ]; then echo "::error title=Game crashed::Oops." && exit 1; fi
48 changes: 48 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release
on:
release:
types: [published]
jobs:
curseforge:
runs-on: ubuntu-latest
steps:
- name: Download pack files
uses: robinraju/[email protected]
id: download-files
with:
fileName: "*.zip"
latest: true
tarBall: false
zipBall: false
preRelease: false
- name: Publish to CurseForge
uses: Kir-Antipov/[email protected]
with:
name: ${{ steps.download-files.outputs.tag_name }}
curseforge-id: 997983
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
curseforge-files: '*.zip'
loaders: fabric
game-versions: ${{ vars.MC_VERSION }}
modrinth:
runs-on: ubuntu-latest
steps:
- name: Download pack files
uses: robinraju/[email protected]
id: download-files
with:
fileName: "*.mrpack"
latest: true
tarBall: false
zipBall: false
preRelease: false
- name: Publish to Modrinth
uses: Kir-Antipov/[email protected]
with:
name: ${{ steps.download-files.outputs.tag_name }}
modrinth-id: Ve6iGkhQ
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
modrinth-unfeature-mode: subset
files: '*.mrpack'
loaders: fabric
game-versions: ${{ vars.MC_VERSION }}

0 comments on commit b65abca

Please sign in to comment.