Skip to content

Publish package to GitHub Packages #5

Publish package to GitHub Packages

Publish package to GitHub Packages #5

Workflow file for this run

name: Publish package to GitHub Packages
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
checks: write
actions: read
issues: read
packages: write
pull-requests: read
repository-projects: read
statuses: read
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: liberica
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Install GitHub CLI
run: |
sudo apt update && sudo apt install gh -y
- name: Publish package
run: |
./gradlew clean setVersion -PnewVersion=${{ github.event.release.tag_name }} build -Dvaadin.productionMode=true -PjarBaseName=sanford-ui
ARTIFACT_PATH=$(./gradlew -q printArtifactPath -PjarBaseName=sanford-ui)
echo "Uploading $(basename $ARTIFACT_PATH) to release ${{ github.event.release.tag_name }}"
gh release upload "${{ github.event.release.tag_name }}" "$ARTIFACT_PATH" --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}