tweaks/.forgejo/workflows/build.yml

57 lines
1.4 KiB
YAML
Raw Normal View History

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