Skip to content

Merge branch 'master' into publish-actions #2244

Merge branch 'master' into publish-actions

Merge branch 'master' into publish-actions #2244

Workflow file for this run

# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
#
# This worflow will also upload an artifact to Nexus, Hangar, Modrinth, and GitHub releases.
name: Java CI with Gradle (& Publish)
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.commits[0].message, '[ci-skip]')"
steps:
- uses: actions/[email protected]
- uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: temurin
java-version: 17
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Test with Gradle
run: ./gradlew test
- name: Build with Gradle
run: ./gradlew build
- name: Upload artifacts
uses: "actions/[email protected]"
with:
name: "IridiumSkyblock"
path: "build/libs/IridiumSkyblock-*.jar"
publish:
needs: build
runs-on: ubuntu-latest
if: "contains(github.event.commits[0].message, 'Version Increment')"
steps:
- name: Downloading artifact
uses: actions/checkout@v2
- uses: thecodemonkey/action-get-gradle-version@master
id: version
with:
file: "build.gradle.kts"
- uses: actions/[email protected]
with:
name: "IridiumSkyblock"
path: "./"
- name: Publishing to Nexus
uses: sonatype-nexus-community/nexus-repo-github-action@master
with:
serverUrl: "https://nexus.iridiumdevelopment.net/"
username: "${{ secrets.NEXUS_USERNAME }}"
password: "${{ secrets.NEXUS_PASSWORD }}"
format: "maven2"
repository: "maven-releases"
coordinates: "groupId=com.iridium artifactId=IridiumSkyblock version=${{steps.version.outputs.version}} generate-pom=on"
assets: "extension=jar"
filename: "IridiumSkyblock-*.jar"
- if: "contains(github.event.commits[0].message, 'Version Increment (Beta)')"
name: Publishing to Hangar (Beta)
uses: benwoo1110/[email protected]
with:
api-token: ${{ secrets.HANGAR_API_TOKEN }}
slug: IridiumSkyblock
channel: beta
version: ${{steps.version.outputs.version}}
files: "IridiumSkyblock-*.jar"
- if: ${{ ! "contains(github.event.commits[0].message, 'Version Increment (Beta)')" }}

Check failure on line 72 in .github/workflows/gradle.yml

View workflow run for this annotation

GitHub Actions / Java CI with Gradle (& Publish)

Invalid workflow file

The workflow is not valid. .github/workflows/gradle.yml (Line: 72, Col: 13): Unexpected symbol: '"contains'. Located at position 3 within expression: ! "contains(github.event.commits[0].message, 'Version Increment (Beta)')" .github/workflows/gradle.yml (Line: 94, Col: 13): Unexpected symbol: '"contains'. Located at position 3 within expression: ! "contains(github.event.commits[0].message, 'Version Increment (Beta)')"
name: Publishing to Hangar (Release)
uses: benwoo1110/[email protected]
with:
api-token: ${{ secrets.HANGAR_API_TOKEN }}
slug: IridiumSkyblock
channel: release
version: ${{steps.version.outputs.version}}
files: "IridiumSkyblock-*.jar"
- if: "contains(github.event.commits[0].message, 'Version Increment (Beta)')"
name: Publish to Modrinth (Beta)
uses: Kir-Antipov/[email protected]
with:
files: "IridiumSkyblock-*.jar"
version: ${{steps.version.outputs.version}}
version-type: beta
modrinth-id: uVMG0MzO
modrinth-featured: true
modrinth-unfeature-mode: any
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
- if: ${{ ! "contains(github.event.commits[0].message, 'Version Increment (Beta)')" }}
name: Publish to Modrinth (Release)
uses: Kir-Antipov/[email protected]
with:
files: "IridiumSkyblock-*.jar"
version: ${{steps.version.outputs.version}}
version-type: release
modrinth-id: uVMG0MzO
modrinth-featured: true
modrinth-unfeature-mode: any
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
- if: "contains(github.event.commits[0].message, 'Version Increment (Beta)')"
name: Publish to Github (Beta)
uses: Kir-Antipov/[email protected]
with:
files: "IridiumSkyblock-*.jar"
version: ${{steps.version.outputs.version}}
version-type: beta
github-tag: steps.pluginVersion.outputs.string
github-token: ${{ secrets.GITHUB_TOKEN }}
- if: ${{ ! "contains(github.event.commits[0].message, 'Version Increment (Beta)')" }}
name: Publish to Github (Release)
uses: Kir-Antipov/[email protected]
with:
files: "IridiumSkyblock-*.jar"
version: ${{steps.version.outputs.version}}
version-type: release
github-tag: ${{steps.version.outputs.version}}
github-token: ${{ secrets.GITHUB_TOKEN }}