Skip to content

Java: Make the EmojiIndex and Ubescape optional dependencies. #2

Java: Make the EmojiIndex and Ubescape optional dependencies.

Java: Make the EmojiIndex and Ubescape optional dependencies. #2

Workflow file for this run

name: GitHub Packages Maven Publish
on:
push:
branches:
- main
release:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'
- name: Update the current version.
working-directory: ./java
run: |
# Extract the tag or commit hash from GITHUB_REF
if [[ "$GITHUB_REF" =~ refs/tags/.* ]]; then
# Extract the tag from GITHUB_REF
VERSION=$(echo "${GITHUB_REF}" | sed -n 's|refs/tags/\(.*\)|\1|p')
else
# Use the short commit hash as the version
VERSION=$(git rev-parse --short HEAD)
fi
mvn versions:set -DnewVersion="$VERSION"
echo ""
echo "Version has been updated to $VERSION."
- name: Build and deploy to GitHub Packages
working-directory: ./java
run: mvn --batch-mode deploy -DaltDeploymentRepository="github::default::https://maven.pkg.github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}