docs: README. #40
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: Publishing | |
on: | |
push: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
packages: write | |
actions: read | |
jobs: | |
Publish: | |
name: Publish | |
runs-on: ubuntu-24.04 | |
if: contains(github.event.head_commit.message, 'published') | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Java JDK | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: '21' | |
distribution: 'graalvm' | |
- name: Make gradlew executable | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew allJar | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_USERNAME: ${{ github.actor }} | |
isGitHubActions: "true" | |
- name: Set outputs | |
id: short_sha | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Get Repository Name | |
uses: MariachiBear/[email protected] | |
- name: Publish to GitHub Packages | |
run: ./gradlew publish -PisGitHubActions=true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_USERNAME: ${{ github.actor }} |