fix: move actions to mouse buttons #116
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: Java CI with Gradle | |
on: | |
push: | |
branches: ["main"] | |
tags: ["v*"] | |
pull_request: | |
workflow_dispatch: | |
env: | |
RELEASE: ${{ github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }} | |
jobs: | |
build: | |
name: Build the project | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
outputs: | |
RELEASE: ${{env.RELEASE}} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "21" | |
distribution: "temurin" | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. | |
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4.1.0 | |
- name: Build with Gradle Wrapper | |
run: ./gradlew build | |
- name: Upload JAR files | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jar | |
path: ${{github.workspace}}/build/libs/ | |
publish: | |
name: Upload packages | |
if: ${{ fromJson(needs.build.outputs.RELEASE) }} | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "21" | |
distribution: "temurin" | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Get packages | |
uses: actions/download-artifact@v4 | |
with: | |
name: jar | |
path: ${{github.workspace}}/build/libs | |
- name: Upload to modrinth | |
run: python -m tools.ci minotaur send "${{github.workspace}}/build/libs" | |
env: | |
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | |
- name: Upload to GitHub release | |
run: python -m tools.ci github publish "${{github.workspace}}/build/libs" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
dependency-submission: | |
name: Check dependencies | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "21" | |
distribution: "temurin" | |
- name: Generate and submit dependency graph | |
uses: gradle/actions/dependency-submission@v4.1.0 |