Skip to content

Commit fd5e8d8

Browse files
author
The Panda Oliver
committed
Update version to 2.0.0-SNAPSHOT and add GitHub Actions for publishing Gradle package
1 parent 1e6b535 commit fd5e8d8

File tree

3 files changed

+68
-1
lines changed

3 files changed

+68
-1
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
6+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
7+
8+
name: Gradle Package
9+
10+
on:
11+
push:
12+
branches:
13+
- "**"
14+
15+
jobs:
16+
build:
17+
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
packages: write
22+
23+
env:
24+
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
25+
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: Set up JDK 21
30+
uses: actions/setup-java@v4
31+
with:
32+
java-version: '21'
33+
distribution: 'temurin'
34+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
35+
settings-path: ${{ github.workspace }} # location for the settings.xml file
36+
37+
- name: Setup Gradle
38+
uses: gradle/actions/setup-gradle@v4
39+
40+
- name: Make gradlew executable
41+
run: chmod +x gradlew
42+
43+
- name: Build with Gradle
44+
run: ./gradlew build
45+
46+
- name: Publish to GitHub Packages
47+
run: ./gradlew publish

build.gradle

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,26 @@ publishing {
113113
name = 'localPluginRepository'
114114
url = '../local-plugin-repository'
115115
}
116+
117+
maven {
118+
url = "https://repo.pandasystems.dev/repository/maven-snapshots/"
119+
name = "PandasSnapshotRepository"
120+
credentials {
121+
username = System.getenv("NEXUS_USERNAME")
122+
password = System.getenv("NEXUS_PASSWORD")
123+
}
124+
}
125+
126+
if (!version.toString().endsWith("SNAPSHOT")) {
127+
maven {
128+
url = "https://repo.pandasystems.dev/repository/maven-releases/"
129+
name = "PandasReleaseRepository"
130+
credentials {
131+
username = System.getenv("NEXUS_USERNAME")
132+
password = System.getenv("NEXUS_PASSWORD")
133+
}
134+
}
135+
}
116136
}
117137
}
118138

src/main/java/io/github/pacifistmc/forgix/Forgix.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import java.util.stream.Collectors;
1616

1717
public class Forgix {
18-
public static final String VERSION = "2.0.0-SNAPSHOT.5.1";
18+
public static final String VERSION = "2.0.0-SNAPSHOT";
1919
private static final String MANIFEST_VERSION_KEY = "Forgix-Version";
2020
private static final String MANIFEST_MAPPINGS_KEY = "Forgix-Mappings";
2121

0 commit comments

Comments
 (0)