Skip to content

Commit

Permalink
GitHub Actions setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Adubbz committed Nov 10, 2023
1 parent 470d59d commit a30c1f5
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 82 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish

on:
workflow_dispatch:
push:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: "Checkout"
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'oracle'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Refresh Gradle Dependencies
run: ./gradlew --refresh-dependencies
- name: Publish
run: ./gradlew publish
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
BUILD_NUMBER: ${{ github.run_number }}
- name: CurseForge Publish
run: ./gradlew curseforge -PcurseApiKey=${CURSE_API_KEY}
env:
CURSE_API_KEY: ${{ secrets.CURSE_API_KEY }}
BUILD_NUMBER: ${{ github.run_number }}
continue-on-error: true
# - name: Modrinth Publish
# run: ./gradlew modrinth -PmodrinthToken=${MODRINTH_TOKEN}
# env:
# MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
# BUILD_NUMBER: ${{ github.run_number }}
# continue-on-error: true
17 changes: 7 additions & 10 deletions Common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,12 @@ publishing {
}
}
repositories {
maven {
url "https://maven.minecraftforge.net/releases/"
authentication {
basic(BasicAuthentication)
}
credentials {
username = System.env.MAVEN_USER ?:'fake'
password = System.env.MAVEN_PASSWORD ?:'news'
}
}
maven {
url = "https://maven.minecraftforge.net/releases/"
credentials {
username = System.getenv("MAVEN_USER")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
17 changes: 7 additions & 10 deletions Fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,12 @@ publishing {
}
}
repositories {
maven {
url "https://maven.minecraftforge.net/releases/"
authentication {
basic(BasicAuthentication)
}
credentials {
username = System.env.MAVEN_USER ?:'fake'
password = System.env.MAVEN_PASSWORD ?:'news'
}
}
maven {
url = "https://maven.minecraftforge.net/releases/"
credentials {
username = System.getenv("MAVEN_USER")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
9 changes: 3 additions & 6 deletions Forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,10 @@ publishing {
}
repositories {
maven {
url "https://maven.minecraftforge.net/releases/"
authentication {
basic(BasicAuthentication)
}
url = "https://maven.minecraftforge.net/releases/"
credentials {
username = System.env.MAVEN_USER ?:'fake'
password = System.env.MAVEN_PASSWORD ?:'news'
username = System.getenv("MAVEN_USER")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
Expand Down
56 changes: 0 additions & 56 deletions Jenkinsfile

This file was deleted.

0 comments on commit a30c1f5

Please sign in to comment.