create-air-fabric/.gitea/workflows/build.yml

69 lines
1.7 KiB
YAML
Raw Normal View History

name: build
on:
pull_request: {}
push: {}
workflow_dispatch: {}
jobs:
build:
2025-01-21 06:43:53 +08:00
env:
RUN_NUMBER: ${{ gitea.run_number }}
strategy:
matrix:
2025-01-21 07:11:54 +08:00
java: [ '17' ]
runs-on: ubuntu-latest
steps:
2025-01-21 05:55:40 +08:00
- name: Checkout Code
2025-01-21 05:39:28 +08:00
uses: actions/checkout@v4
2025-01-21 05:55:40 +08:00
- name: Setup JDK ${{ matrix.java }}
2025-01-21 05:39:28 +08:00
uses: actions/setup-java@v4
with:
2025-01-21 17:58:17 +08:00
distribution: 'oracle'
java-version: ${{ matrix.java }}
2025-01-21 18:19:33 +08:00
cache: 'gradle'
2025-01-21 18:08:20 +08:00
- name: Loom Cache
2025-01-21 06:28:15 +08:00
uses: actions/cache@v4
with:
2025-01-21 18:08:20 +08:00
path: "**/.gradle/loom-cache"
key: "${{ runner.os }}-gradle-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }}"
restore-keys: "${{ runner.os }}-gradle-"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-home-cache-cleanup: true
- name: Validate Gradle Wrapper Integrity
uses: gradle/wrapper-validation-action@v2
2025-01-21 05:55:40 +08:00
- name: Build with Gradle
2025-01-21 18:19:33 +08:00
run: ./gradlew build --no-daemon
2025-01-21 05:55:40 +08:00
- name: Upload Mod JAR
2025-01-21 19:57:06 +08:00
uses: actions/upload-artifact@v3
2025-01-21 05:55:40 +08:00
with:
name: create-air-fabric
path: build/libs/*.jar
upload-release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: create-air-fabric
2025-01-21 05:39:28 +08:00
- name: Make release
2025-01-21 05:46:41 +08:00
uses: akkuman/gitea-release-action@v1
with:
2025-01-21 06:03:53 +08:00
name: Create Air Fabric 1.0-${{ gitea.run_number }} for 1.20.1
2025-01-21 06:24:20 +08:00
tag_name: createairfabric-1.0+1.20.1-${{ gitea.run_number }}
2025-01-21 05:39:28 +08:00
md5sum: true
sha256sum: true
files: |-
2025-01-21 06:24:20 +08:00
*.jar
2025-01-21 05:55:40 +08:00
# build/libs/**