Deploy #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
required: true | |
description: Release version | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
cache: 'gradle' | |
- name: Update Core plugin.json Version | |
uses: jossef/[email protected] | |
with: | |
file: ./genesis-core/plugin.json | |
field: version | |
value: ${{ github.event.inputs.version }} | |
- name: Update Standard plugin.json Version | |
uses: jossef/[email protected] | |
with: | |
file: ./genesis-standard/plugin.json | |
field: version | |
value: ${{ github.event.inputs.version }} | |
- name: Build Artifact | |
run: ./gradlew jar | |
- name: Get artifact path | |
run: | | |
echo "GENESIS_CORE_ARTIFACT_PATH=$(./gradlew :genesis-core:getArtifactPath -q)" >> $GITHUB_ENV | |
echo "GENESIS_STANDARD_ARTIFACT_PATH=$(./gradlew :genesis-standard:getArtifactPath -q)" >> $GITHUB_ENV | |
- name: Publish | |
run: | | |
./gradlew publish \ | |
-PreposiliteUsername=${{ secrets.MAVEN_NAME }} \ | |
-PreposilitePassword=${{ secrets.MAVEN_SECRET }} | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
prerelease: false | |
tag_name: v${{ github.event.inputs.version }} | |
body: | | |
Version ${{ github.event.inputs.version }} | |
files: | | |
${{ env.GENESIS_CORE_ARTIFACT_PATH }} | |
${{ env.GENESIS_STANDARD_ARTIFACT_PATH }} | |
# Lower the chance that commit will fail because branch was changed at the same time with this workflow | |
- name: Pull Git Changes | |
run: git pull | |
- name: Commit | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "chore: Increment versions" |