Skip to content

Commit

Permalink
Upgrade Vaadin. Update CI and Add Release Github Action workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
pacphi committed Oct 18, 2024
1 parent 07f1712 commit 60a3b4f
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ jobs:
name: Java ${{ matrix.java }} build
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: ${{ matrix.java }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build with Gradle
run: ./gradlew build
run: ./gradlew clean build -Dvaadin.productionMode=true
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Publish package to GitHub Packages
on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- jar-base-name: sanford-ui
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: Build artifact
run: |
./gradlew clean setVersion -PnewVersion=${{ github.event.release.tag_name }}
cat gradle.properties
./gradlew build -Dvaadin.productionMode=true -PjarBaseName=${{ matrix.jar-base-name }}
echo "Contents of build/libs:"
ls -l build/libs
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.jar-base-name }}
path: build/libs/${{ matrix.jar-base-name }}-${{ github.event.release.tag_name }}.jar
if-no-files-found: error
retention-days: 1

publish:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
checks: write
actions: read
issues: read
packages: write
pull-requests: read
repository-projects: read
statuses: read
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Publish assets and generate release notes
uses: softprops/action-gh-release@v2
with:
files: |
*/*.jar
fail_on_unmatched_files: true
generate_release_notes: true
token: ${{ secrets.GITHUB_TOKEN }}
20 changes: 17 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ plugins {
}

group = 'org.cftoolsuite'
version = '0.0.1-SNAPSHOT'

java {
toolchain {
Expand All @@ -23,7 +22,7 @@ repositories {

ext {
set('springCloudVersion', "2023.0.3")
set('vaadinVersion', "24.4.13")
set('vaadinVersion', "24.5.0")
}

dependencies {
Expand Down Expand Up @@ -55,4 +54,19 @@ tasks.named('test') {

bootRun {
systemProperties System.properties
}
}

task setVersion {
doLast {
def newVersion = project.hasProperty('newVersion') ? project.newVersion : version
ant.propertyfile(file: "gradle.properties") {
entry(key: "version", value: newVersion)
}
}
}

task printArtifactPath {
doLast {
println bootJar.archiveFile.get().asFile.absolutePath
}
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version=0.0.1-SNAPSHOT

0 comments on commit 60a3b4f

Please sign in to comment.