Skip to content

Commit

Permalink
New GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ZigyTheBird committed Jan 31, 2025
1 parent 77fe665 commit 5493b29
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish to maven repository.

on:
workflow_dispatch:
inputs:
branch:
type: choice
description: Which branch do you want to publish?
options:
- 1.21
- 1.20.4
- 1.20.1
forge:
type: choice
description: NeoForge or Forge?
options:
- neoforge
- forge

jobs:
build_dev:
uses: zigythebird/zigysplayeranimatorapi/.github/workflows/[email protected]
with:
branch: ${{ inputs.branch }}
GITHUB_REF: ${{ github.ref }}
upload_docs: true
forge: ${{ inputs.forge }}
secrets:
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
61 changes: 61 additions & 0 deletions .github/workflows/mavenbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
on:
workflow_call:
inputs:
branch:
required: true
type: string
GITHUB_REF:
required: true
type: string
upload_docs:
required: true
type: boolean
forge:
required: true
type: string
secrets:
MAVEN_TOKEN:
required: true


jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Branch
uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}

- name: Restore gradle.properties
shell: bash
env:
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
run: |
mkdir -p ~/.gradle/
echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV
echo "${MAVEN_TOKEN}" > ~/.gradle/gradle.properties
- name: Get Artifact Id
uses: actions/github-script@v5
id: artifact_id
env:
branch: '${{ inputs.branch }}'
with:
result-encoding: string
script: |
// use env branch replace / with _
return process.env.branch.replace(/\//g, '_')
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 21

- name: Grant Execute Permission
run: chmod +x gradlew

- name: Build
run: |
./gradlew publishMavenJavaPublicationToMavenRepository

0 comments on commit 5493b29

Please sign in to comment.