-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
60b6bee
commit 73977b7
Showing
1 changed file
with
71 additions
and
71 deletions.
There are no files selected for viewing
142 changes: 71 additions & 71 deletions
142
.github/workflows/build.yml → .github/workflows/release.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,71 @@ | ||
# Automatically build the project and run any configured tests for every push | ||
# and submitted pull request. This can help catch issues that only occur on | ||
# certain platforms or Java versions, and provides a first line of defence | ||
# against bad commits. | ||
|
||
name: build | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
changes: | ||
type: string | ||
required: true | ||
description: "Description to show in changelog" | ||
permissions: | ||
contents: write | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v3 | ||
- name: import Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: validate gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: setup jdk 21 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 21 | ||
distribution: "microsoft" | ||
- name: cache loom | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches/fabric-loom | ||
.gradle/loom-cache | ||
build/loom-cache | ||
**/build/loom-cache | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
|
||
- name: make gradle wrapper executable | ||
run: chmod +x ./gradlew | ||
- name: build | ||
run: ./gradlew build | ||
- name: export gradle.properties as env vars | ||
run: | | ||
export `sed -e '/^#/d' -e '/^org/d' gradle.properties` | ||
echo "mod_version=$mod_version" >> $GITHUB_ENV | ||
echo "minecraft_version=$minecraft_version" >> $GITHUB_ENV | ||
- name: Publich to Modrinth and CurseForge | ||
uses: Kir-Antipov/mc-publish@v3.3 | ||
with: | ||
modrinth-id: fK1LHuQH | ||
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | ||
modrinth-version: "${{ env.mod_version }}.${{ env.minecraft_version }}" | ||
|
||
curseforge-id: 971238 | ||
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | ||
|
||
github-tag: v${{ env.mod_version }}-${{ env.minecraft_version }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
name: "[Fabric ${{env.minecraft_version}}] ${{env.mod_version}}" | ||
version: ${{ env.mod_version }} | ||
version-type: release | ||
game-versions: ${{ env.minecraft_version }} | ||
|
||
loaders: fabric | ||
changelog: ${{ inputs.changes}} | ||
# Automatically build the project and run any configured tests for every push | ||
# and submitted pull request. This can help catch issues that only occur on | ||
# certain platforms or Java versions, and provides a first line of defence | ||
# against bad commits. | ||
|
||
name: build | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
changes: | ||
type: string | ||
required: true | ||
description: "Description to show in changelog" | ||
permissions: | ||
contents: write | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v3 | ||
- name: import Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: validate gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: setup jdk 21 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 21 | ||
distribution: "microsoft" | ||
- name: cache loom | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches/fabric-loom | ||
.gradle/loom-cache | ||
build/loom-cache | ||
**/build/loom-cache | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
|
||
- name: make gradle wrapper executable | ||
run: chmod +x ./gradlew | ||
- name: build | ||
run: ./gradlew build | ||
- name: export gradle.properties as env vars | ||
run: | | ||
export `sed -e '/^#/d' -e '/^org/d' gradle.properties` | ||
echo "mod_version=$mod_version" >> $GITHUB_ENV | ||
echo "minecraft_version=$minecraft_version" >> $GITHUB_ENV | ||
- name: Publich to Modrinth and CurseForge | ||
uses: Kir-Antipov/mc-publish@v3.3 | ||
with: | ||
modrinth-id: fK1LHuQH | ||
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | ||
modrinth-version: "${{ env.mod_version }}.${{ env.minecraft_version }}" | ||
|
||
curseforge-id: 971238 | ||
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | ||
|
||
github-tag: v${{ env.mod_version }}-${{ env.minecraft_version }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
name: "[Fabric ${{env.minecraft_version}}] ${{env.mod_version}}" | ||
version: ${{ env.mod_version }} | ||
version-type: release | ||
game-versions: ${{ env.minecraft_version }} | ||
|
||
loaders: fabric | ||
changelog: ${{ inputs.changes}} |