From 2eb837f8cfc568429031d1a1f78d6969cf3d5192 Mon Sep 17 00:00:00 2001 From: Steven Tracey Date: Tue, 22 Oct 2024 14:12:12 -0400 Subject: [PATCH] Gitea Workflow --- .gitea/workflows/build.yml | 40 ++++++++++++++++++++++++++++++++++++++ build.gradle | 4 ++-- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index e69de29..cc908d8 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -0,0 +1,40 @@ +name: JConf Actions Workflow +run-name: Deploy to ${{ inputs.deploy_target }} by ${{ gitea.actor }} +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup JDK 21 + uses: actions/setup-java@v4.4.0 + with: + java-version: 21 + distribution: 'temurin' + - name: Configure Git + run: | + git config --global user.email "git@nevets.tech" + git config --global user.name "Gitea Actions" + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build JConf + run: ./gradlew clean build shadowJar + - name: Prepare Artifacts + run: | + rm -rf ./artifacts + mkdir -p "./artifacts" + export VERSION=$(grep version build.gradle | grep -vE id | grep -vE : | awk -F"'" '/version/{print$2}') + echo $VERSION + cp -v "./build/libs/JConf-$VERSION.jar" "./artifacts/JConf-$VERSION-no-deps.jar" + cp -v "./build/libs/JConf-$VERSION-all.jar" "./artifacts/JConf-$VERSION.jar" + - name: Maven Upload + run: | + export giteaUser=${{ secrets.USERNAME_GITEA }} + export giteaPass=${{ secrets.ACCESS_TOKEN_GITEA }} + ./gradlew publish + - name: Upload JConf Artifacts + uses: actions/upload-artifacts@v4 + with: + name: JConf + path: artifacts/* diff --git a/build.gradle b/build.gradle index 01eecc2..f55a8f5 100644 --- a/build.gradle +++ b/build.gradle @@ -18,11 +18,11 @@ apply plugin: 'maven-publish' publishing { publications{ publish(MavenPublication) { - artifact("gitea/JConf-$version" + "-no-deps.jar") { + artifact("artifacts/JConf-$version" + "-no-deps.jar") { classifier 'no-deps' extension 'jar' } - artifact("gitea/JConf-$version" + ".jar") { + artifact("artifacts/JConf-$version" + ".jar") { extension 'jar' } }