Auto Build, Publish, Releasing #50
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: Auto Build, Publish, Releasing | |
on: workflow_dispatch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
MAVEN_PASS: ${{ secrets.MAVEN_PASS }} | |
MAVEN_USER: ${{ secrets.MAVEN_USER }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build and Publish | |
uses: gradle/[email protected] | |
with: | |
arguments: build publish | |
- name: Get Version | |
id: var | |
run: | | |
MESSAGE=$(ls fabric/build/libs/* | grep sources.jar -v | grep shadow.jar -v | awk -F 'photon-fabric-|.jar' '{print $2}') | |
echo fabric_version=$MESSAGE >> $GITHUB_OUTPUT | |
MESSAGE=$(ls forge/build/libs/* | grep sources.jar -v | grep shadow.jar -v | awk -F 'photon-forge-|.jar' '{print $2}') | |
echo forge_version=$MESSAGE >> $GITHUB_OUTPUT | |
- name: mc-publish-fabric | |
uses: Kir-Antipov/[email protected] | |
with: | |
# Only include this section if you wish to publish | |
# your assets on Modrinth. | |
modrinth-id: gzevkJbM | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
# Only include this section if you wish to publish | |
# your assets on CurseForge. | |
curseforge-id: 871522 | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
files: | | |
fabric/build/libs/!(*-@(dev|sources|javadoc|dev-shadow)).jar | |
fabric/build/libs/*-@(dev|sources|javadoc|dev-shadow).jar | |
name: Photon Editor ${{ steps.var.outputs.fabric_version }}-fabric | |
version: mc${{ steps.var.outputs.fabric_version }}-fabric | |
version-type: beta | |
changelog-file: CHANGELOG.* | |
loaders: | | |
fabric | |
game-versions: | | |
${{ github.ref_name }} | |
game-version-filter: none | |
java: | | |
17 | |
retry-attempts: 2 | |
retry-delay: 10000 | |
fail-mode: fail | |
- name: mc-publish-forge | |
uses: Kir-Antipov/[email protected] | |
with: | |
# Only include this section if you wish to publish | |
# your assets on Modrinth. | |
modrinth-id: gzevkJbM | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
# Only include this section if you wish to publish | |
# your assets on CurseForge. | |
curseforge-id: 871522 | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
files: | | |
forge/build/libs/!(*-@(dev|sources|javadoc|dev-shadow)).jar | |
forge/build/libs/*-@(dev|sources|javadoc|dev-shadow).jar | |
name: Photon Editor ${{ steps.var.outputs.forge_version }}-forge | |
version: mc${{ steps.var.outputs.forge_version }}-forge | |
version-type: beta | |
changelog-file: CHANGELOG.* | |
loaders: | | |
forge | |
game-versions: | | |
${{ github.ref_name }} | |
game-version-filter: none | |
java: | | |
17 | |
retry-attempts: 2 | |
retry-delay: 10000 | |
fail-mode: fail |