tweaks/.forgejo/workflows/build.yml

53 lines
1.3 KiB
YAML

name: Build ExploreCraft Tweaks
#on: [pull_request, push]
on:
push:
tags:
- '*'
jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
21, # Current Java LTS
]
runs-on: ubuntu-latest
steps:
- name: ⏬ Checkout repository
uses: actions/checkout@v4
- name: 🔧 Setup go for releases
uses: https://github.com/actions/setup-go@v4
with:
go-version: '>=1.20.1'
- name: ✅ Validate gradle wrapper
uses: https://github.com/gradle/wrapper-validation-action@v2
- name: 🛠️ Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: "microsoft"
- name: ▶️ Make gradle wrapper executable
run: chmod +x ./gradlew
- name: 🔧 Build ExploreCraft Tweaks
run: ./gradlew build
- name: 🫳 Capture build artifacts
if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java
uses: actions/upload-artifact@v3
with:
name: ec-tweaks-build
path: build/libs/
- name: ⏫ Publish release
uses: actions/release-action@main
with:
files: |-
build/libs/**
api_key: '${{secrets.PUBLISH_TOKEN}}'