Release #346
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
name: Release | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
java: [ 17 ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: setup JDK${{ matrix.java }} | |
uses: actions/setup-java@v1 | |
with: | |
java-version: ${{ matrix.java }} | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/loom-cache | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: Get Mod Version | |
id: mod_version | |
run: grep "mod_version" gradle.properties | sed "s/\s//g" >> $GITHUB_OUTPUT | |
- name: Get Platform Version | |
id: minecraft_version | |
run: grep "minecraft_version" gradle.properties | sed "s/\s//g" >> $GITHUB_OUTPUT | |
- name: Get Composite Version | |
id: composite_version | |
run: echo "composite_version=${{ steps.mod_version.outputs.mod_version }}+${{ steps.minecraft_version.outputs.minecraft_version }}" >> $GITHUB_OUTPUT | |
- name: Build Fabric | |
env: | |
RELEASE: true | |
run: ./gradlew :fabric:build | |
- name: Build Forge | |
env: | |
RELEASE: true | |
run: ./gradlew :forge:build | |
- name: Publish | |
env: | |
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | |
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} | |
RELEASE: true | |
run: ./gradlew publish modrinth curseforge -PmavenUrl="${{ secrets.MAVEN_URL }}" -PmavenUsername="${{ secrets.MAVEN_USERNAME }}" -PmavenPassword="${{ secrets.MAVEN_PASSWORD }}" | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.composite_version.outputs.composite_version }} | |
release_name: EMI ${{ steps.composite_version.outputs.composite_version }} | |
body_path: CHANGELOG.md | |
draft: false | |
prerelease: false | |
- name: Upload Fabric Release Asset | |
id: upload_fabric_release_asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./fabric/build/libs/emi-${{ steps.composite_version.outputs.composite_version }}+fabric.jar | |
asset_name: emi-${{ steps.composite_version.outputs.composite_version }}+fabric.jar | |
asset_content_type: application/java-archive | |
- name: Upload Forge Release Asset | |
id: upload_forge_release_asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./forge/build/libs/emi-${{ steps.composite_version.outputs.composite_version }}+forge.jar | |
asset_name: emi-${{ steps.composite_version.outputs.composite_version }}+forge.jar | |
asset_content_type: application/java-archive |