Skip to content

Commit

Permalink
Switch to common publish actions and upgrade to Java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
BomBardyGamer committed Sep 28, 2023
1 parent 7f9c66b commit 414cd90
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 43 deletions.
27 changes: 6 additions & 21 deletions .github/workflows/maven-development.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
name: Publish to development (snapshot) repo
name: "Publish to development (snapshot) repo"

on: push

jobs:
publish:
runs-on: ubuntu-latest
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- name: Get Commit Hash
id: commit
uses: pr-mpt/actions-commit-hash@v2
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4
- name: Publish package
uses: gradle/gradle-build-action@ced6859e9c4c384100f94984814deb1bd361f648
- uses: "emortalmc/actions/java/publish-dev@main"
with:
arguments: publishMavenPublicationToDevelopmentRepository
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_SECRET: ${{ secrets.MAVEN_SECRET }}
COMMIT_HASH: ${{ steps.commit.outputs.hash }}
COMMIT_HASH_SHORT: ${{ steps.commit.outputs.short }}
maven-username: "${{ secrets.MAVEN_USERNAME }}"
maven-password: "${{ secrets.MAVEN_SECRET }}"
26 changes: 6 additions & 20 deletions .github/workflows/maven-release.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
name: Publish to release repo
name: "Publish to release repo"

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- name: Get Commit Hash
id: commit
uses: pr-mpt/actions-commit-hash@v2
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4
- name: Publish package
uses: gradle/gradle-build-action@ced6859e9c4c384100f94984814deb1bd361f648
- uses: "emortalmc/actions/java/publish-release@main"
with:
arguments: publishMavenPublicationToReleaseRepository
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_SECRET: ${{ secrets.MAVEN_SECRET }}
RELEASE_VERSION: ${{ github.ref_name }}
maven-username: "${{ secrets.MAVEN_USERNAME }}"
maven-password: "${{ secrets.MAVEN_SECRET }}"
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies {

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
languageVersion.set(JavaLanguageVersion.of(21))
}

withSourcesJar()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/emortal/api/modules/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public final class ModuleManager implements ModuleProvider {

private final Map<Class<? extends Module>, Module> modules = new ConcurrentHashMap<>();

public ModuleManager(@NotNull ModuleCandidateResolver candidateResolver, @NotNull ModuleSorter sorter,
private ModuleManager(@NotNull ModuleCandidateResolver candidateResolver, @NotNull ModuleSorter sorter,
@NotNull ModuleEnvironmentProvider environmentProvider) {
this.candidateResolver = candidateResolver;
this.sorter = sorter;
Expand Down

0 comments on commit 414cd90

Please sign in to comment.