Update to new build and release workflow.
release / build (21) (push) Successful in 11m25s

This commit is contained in:
2025-01-01 04:16:17 -07:00
parent 37e2634f08
commit 679428c04f
4 changed files with 58 additions and 43 deletions
+43
View File
@@ -0,0 +1,43 @@
name: release
on:
push:
tags:
- "*"
env:
VERSION: "${{github.ref_name}}"
jobs:
build:
strategy:
matrix:
java: [
21, # Current Java LTS
]
runs-on: ubuntu-22.04
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: "temurin"
- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
- name: publish maven
continue-on-error: true
env:
MAVEN_TOKEN: "${{secrets.MAVEN_TOKEN}}"
run: ./gradlew publish
- name: publish release
uses: akkuman/gitea-release-action@v1
with:
files: |-
build/libs/**
token: "${{secrets.GITHUB_TOKEN}}"
-37
View File
@@ -1,37 +0,0 @@
# Automatically build the project and run any configured tests for every push
# and submitted pull request. This can help catch issues that only occur on
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.
name: build
on: [pull_request, push]
jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
21, # Current Java LTS
]
runs-on: ubuntu-22.04
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: validate gradle wrapper
uses: 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
run: ./gradlew build
- name: capture build artifacts
if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java
uses: christopherhx/gitea-upload-artifact@v4
with:
name: Artifacts
path: build/libs/
+14 -5
View File
@@ -3,6 +3,10 @@ plugins {
id 'maven-publish'
}
if (System.getenv("VERSION")) {
project.mod_version = System.getenv("VERSION")
}
version = "${project.mod_version}-${project.minecraft_version}"
group = project.maven_group
@@ -98,11 +102,16 @@ publishing {
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
maven {
name = "personal"
url = "https://maven.bigduckie.dev/releases"
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
name = "Gitea"
url = uri("https://git.bigduckie.dev/api/packages/big-duckie/maven")
credentials(HttpHeaderCredentials) {
name = "Authorization"
value = "token ${System.getenv("MAVEN_TOKEN")}"
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
+1 -1
View File
@@ -9,7 +9,7 @@ yarn_mappings=1.20.1+build.10
loader_version=0.16.7
# Mod Properties
mod_version=1.1.0
mod_version=dev
maven_group=dev.bigduckie
archives_base_name=static-content