Skip to content

Commit

Permalink
Fix github action workflows (no builds gets ever uploaded as artifact) (
Browse files Browse the repository at this point in the history
#805)

* Update check_build.yml

* Update release.yml

* Update actions

* Update action 2
  • Loading branch information
TheBossMagnus authored Dec 3, 2024
1 parent 9466a21 commit 0b766b8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 32 deletions.
23 changes: 7 additions & 16 deletions .github/workflows/check_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,25 @@ on: [push, pull_request]

jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
21, # Minimum
]
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v3
uses: gradle/actions/wrapper-validation@v4
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: ${{ matrix.java }}
java-version: 21
- name: Make Gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: Build
run: ./gradlew build --stacktrace --parallel
- name: Capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from LTS java on one OS
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: build/libs/
24 changes: 8 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,14 @@ on:
required: true
jobs:
release:
strategy:
matrix:
# Use these Java versions
java: [21]
# and run on both Linux and Windows
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create version tag
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
Expand All @@ -35,14 +29,13 @@ jobs:
- name: Fetch tags
run: git fetch --tags
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v3
uses: gradle/actions/wrapper-validation@v4
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: ${{ matrix.java }}
java-version: 21
- name: Make Gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: Build
run: ./gradlew generateChangelog build publish github modrinth curseforge --stacktrace --parallel -PlastTag="v${{ github.event.inputs.previousVersion }}" -PcurrentTag="v${{ github.event.inputs.version }}"
Expand All @@ -55,8 +48,7 @@ jobs:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
DISCORD_ANNOUNCEMENT_WEBHOOK: ${{ secrets.DISCORD_ANNOUNCEMENT_WEBHOOK }}
- name: Capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from LTS java on one OS
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: build/libs/

0 comments on commit 0b766b8

Please sign in to comment.