diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml new file mode 100644 index 0000000..170a9a5 --- /dev/null +++ b/.github/workflows/Build.yml @@ -0,0 +1,25 @@ +name: Build + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup JDK 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: 'temurin' + cache: gradle + - name: Make gradlew executable + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew build \ No newline at end of file diff --git a/.github/workflows/Publish.yml b/.github/workflows/Publish.yml new file mode 100644 index 0000000..169d9ca --- /dev/null +++ b/.github/workflows/Publish.yml @@ -0,0 +1,22 @@ +name: Publish Gradle package + +on: [workflow_dispatch] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup JDK 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: 'temurin' + cache: gradle + - name: Make gradlew executable + run: chmod +x gradlew + - name: Publish with Gradle + run: ./gradlew publish + env: + PUBLISH_USER: ${{ secrets.PUBLISH_USER }} + PUBLISH_PASSWORD: ${{ secrets.PUBLISH_PASSWORD }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 0e4a498..93a8da9 100644 --- a/.gitignore +++ b/.gitignore @@ -116,5 +116,4 @@ run/ runs/ # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) -!gradle-wrapper.jar -gradle.properties \ No newline at end of file +!gradle-wrapper.jar \ No newline at end of file diff --git a/build.gradle b/build.gradle index 949b758..580236b 100644 --- a/build.gradle +++ b/build.gradle @@ -61,8 +61,8 @@ publishing { name = "GitHubPackages" url = uri("https://maven.pkg.github.com/Touchie771/MinecraftGUI") credentials { - username = project.findProperty("user") ?: System.getenv("USERNAME") - password = project.findProperty("key") ?: System.getenv("TOKEN") + username = System.getenv("PUBLISH_USER") + password = System.getenv("PUBLISH_PASSWORD") } } }