Skip to content

Commit

Permalink
Fix actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaargolo committed Sep 30, 2024
1 parent eb604c1 commit 0e5c316
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 28 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@v4
with:
name: Artifacts
path: build/libs/
43 changes: 29 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
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 github curseforge modrinth --stacktrace
env:
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GH_API_KEY }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
- 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 github curseforge modrinth --stacktrace
env:
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GH_API_KEY }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}

0 comments on commit 0e5c316

Please sign in to comment.