Skip to content

Commit

Permalink
Add Building and Reposting with CI (third time's the charm) (#5)
Browse files Browse the repository at this point in the history
* Maven Build + Publish Test

* Fix Workflow

* Prepare for PR
  • Loading branch information
FOREVEREALIZE authored Dec 1, 2023
1 parent c4aef40 commit d92b2e6
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Maven Build

on:
push:
pull_request:

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: github
settings-path: ${{ github.workspace }}

- name: Build with Gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25
with:
arguments: build

- name: Publish to GitHub Packages
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25
with:
arguments: publish
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 23 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ buildscript {

plugins {
id 'net.minecraftforge.gradle' version '5.1.+'
id 'maven-publish'
}

apply plugin: 'org.spongepowered.mixin'
Expand Down Expand Up @@ -203,4 +204,25 @@ jar.finalizedBy('reobfJar')

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
}

publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId project.archivesBaseName
version project.version
artifact jar
}
}
repositories {
maven {
name = "GithubPackages"
url = "https://maven.pkg.github.com/NewWind-Modpacks/actions-of-stamina"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
Empty file modified gradlew
100644 → 100755
Empty file.

0 comments on commit d92b2e6

Please sign in to comment.