Skip to content

Commit

Permalink
New CI script
Browse files Browse the repository at this point in the history
  • Loading branch information
LatvianModder committed Apr 28, 2024
1 parent 667dd74 commit f0d3ffc
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
34 changes: 25 additions & 9 deletions .github/workflows/build_main.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,64 @@
name: Java CI
name: Java CI (1.20.5)

on:
push:
branches:
- "main"
- 'main'
workflow_dispatch:
branches:
- 'main'
inputs:
norelease:
description: 'Do not publish'
release_type:
description: 'Release Type'
required: true
default: 'false'
type: choice
default: 'release'
options:
- 'release'
- 'beta'
- 'alpha'
- 'none'

jobs:
build:
runs-on: ubuntu-latest
if: |
!contains(github.event.head_commit.message, '[ci skip]')
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Build and Publish with Gradle
uses: gradle/gradle-build-action@v2
env:
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
SAPS_TOKEN: ${{ secrets.SAPS_TOKEN }}
with:
arguments: build -x test publish --stacktrace --no-daemon

- name: Release to CurseForge
uses: gradle/gradle-build-action@v2
if: |
contains(github.ref, 'main') && !contains(github.event.head_commit.message, '[norelease]') && github.event.inputs.norelease != 'true'
if: ${{ github.event_name == 'workflow_dispatch' && inputs.release_type != 'none' }}
env:
GIT_COMMIT: ${{ github.event.after }}
GIT_PREVIOUS_COMMIT: ${{ github.event.before }}
CURSEFORGE_KEY: ${{ secrets.CURSEFORGE_KEY }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
RELEASE_TYPE: ${{ inputs.release_type }}
with:
arguments: build -x test publishUnified --stacktrace --no-daemon
arguments: publishUnified --stacktrace --no-daemon
2 changes: 1 addition & 1 deletion .kubejs/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"downloads": [
{
"name": "Download",
"url": "https://maven.latvian.dev/releases/dev/latvian/mods/rhino/{version}/rhino-{version}.jar"
"url": "https://maven.latvian.dev/releases/dev/latvian/mods/rhino-neoforge/{version}/rhino-neoforge-{version}.jar"
}
]
}
2 changes: 1 addition & 1 deletion lat.ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"downloads": [
{
"name": "Download",
"url": "https://maven.latvian.dev/releases/dev/latvian/mods/rhino/{version}/rhino-{version}.jar"
"url": "https://maven.latvian.dev/releases/dev/latvian/mods/rhino-neoforge/{version}/rhino-neoforge-{version}.jar"
}
]
}

0 comments on commit f0d3ffc

Please sign in to comment.