Skip to content

Merge pull request #93 from UltiKits/alpha #11

Merge pull request #93 from UltiKits/alpha

Merge pull request #93 from UltiKits/alpha #11

Workflow file for this run

name: UltiTools API CI with Maven
on:
push:
branches: [ "main" ]
paths:
- 'UltiTools-API/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package javadoc:javadoc -Dmaven.javadoc.skip=true --file UltiTools-API/pom.xml
- name: Get Project Version from pom.xml
id: version
uses: avides/actions-project-version-check@v1.4.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
file-to-check: UltiTools-API/pom.xml
only-return-version: true
- name: Archive artifacts
uses: actions/upload-artifact@v4.0.0
with:
name: ultitools-artifact
path: UltiTools-API/target/UltiTools-API-${{ steps.version.outputs.version }}.jar
- name: Deploy Java DOC
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
with:
server: ${{ secrets.FTP_HOST }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: "./UltiTools-API/target/site/apidocs/"
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get latest commit message
id: commit
run: echo "::set-output name=message::$(git log --format=%B -n 1 ${{ github.sha }})"
- name: Get Project Version from pom.xml
id: version
uses: avides/actions-project-version-check@v1.4.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
file-to-check: UltiTools-API/pom.xml
only-return-version: true
- name: Download artifacts
uses: actions/download-artifact@v4.1.0
with:
name: ultitools-artifact
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.version.outputs.version }}
release_name: Release v${{ steps.version.outputs.version }}
body: ${{ steps.commit.outputs.message }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: UltiTools-API-${{ steps.version.outputs.version }}.jar
asset_name: UltiTools-API.jar
asset_content_type: application/java-archive