Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
NertzhulDEV committed Jul 21, 2024
1 parent 44430d2 commit f006869
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 30 deletions.
44 changes: 30 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,38 @@
name: Build

on: [push]
on: [ push, workflow_dispatch ]

jobs:
build:
strategy:
matrix:
java: [ 21 ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}

runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

container:
image: openjdk:17-jdk
options: --user root
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

steps:
- uses: actions/[email protected]
- run: |
chmod +x ./gradlew
./gradlew build
- uses: actions/upload-artifact@v2
with:
name: build-artifacts
path: build/libs/
- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: ${{ matrix.java }}

- name: Make Gradle wrapper executable
run: chmod +x ./gradlew

- name: Build
run: ./gradlew build --stacktrace --parallel

- name: Capture build artifacts
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: build/libs/
47 changes: 31 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,39 @@
name: Release

on: [workflow_dispatch]
on: [ workflow_dispatch ]

jobs:
release:
strategy:
matrix:
java: [ 21 ]
os: [ ubuntu-latest ]

runs-on: ubuntu-latest

container:
image: openjdk:17-jdk
options: --user root
runs-on: ${{ matrix.os }}

steps:
- uses: actions/[email protected]
- run: |
chmod +x ./gradlew
./gradlew build publish github curseforge modrinth --stacktrace
env:
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GH_API_KEY }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: ${{ matrix.java }}

- name: Make Gradle wrapper executable
run: chmod +x ./gradlew

- name: Build
run: ./gradlew build publish github curseforge modrinth --stacktrace
env:
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GH_API_KEY }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}

0 comments on commit f006869

Please sign in to comment.