Skip to content

Commit

Permalink
Merge branch 'development' into dependabot/maven/vertx-vaadin-flow/co…
Browse files Browse the repository at this point in the history
…m.fasterxml.jackson.core-jackson-databind-2.13.4.2
  • Loading branch information
mcollovati authored Dec 31, 2023
2 parents 42cb3de + 0b68441 commit f07fbaa
Show file tree
Hide file tree
Showing 15 changed files with 404 additions and 114 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/deploy-classifiers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Deploy vaadin-flow-sockjs classifiers

on:
workflow_dispatch:
inputs:
script-from-branch:
description: "Checkout deploy script from dispatching branch"
type: boolean
default: false
schedule:
- cron: '0 2 * * *'

Expand All @@ -22,7 +27,15 @@ jobs:
ref: ${{ matrix.branch }}
fetch-depth: 0
- name: Checkout latest tag
run: git checkout $(git describe --abbrev=0 --tags --match="flow-*")
id: checkout-tag
run: |
TAG=$(git describe --abbrev=0 --tags --match="flow-*")
VERSION=${TAG/flow-/}
echo "vertx-vaadin-version=${VERSION}" >> "$GITHUB_OUTPUT"
git checkout $TAG
- name: Checkout deploy script
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.script-from-branch }}
run: git checkout $GITHUB_WORKFLOW_SHA -- tools/build_flow_widgetsets.sh
- name: Set up Java
uses: actions/setup-java@v3
with: # running setup-java again overwrites the settings.xml
Expand All @@ -33,8 +46,11 @@ jobs:
server-password: REPSY_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Set version
run: mvn -N -ntp versions:set -DnewVersion="${{ steps.checkout-tag.outputs.vertx-vaadin-version }}"
- name: Deploy classifiers
run: |
set -x -e -o pipefail
./mvnw -N -ntp install
PRJ_VERSION=$(./mvnw -pl :vaadin-flow-sockjs help:evaluate -q -Dexpression='project.version' -DforceStdout)
KIND=$( [[ "${PRJ_VERSION}" =~ "-SNAPSHOT"$ ]] && echo "snapshot" || echo "release" )
Expand Down
111 changes: 111 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Release
run-name: "Release ${{ inputs.version }} from branch ${{ inputs.target-branch }} ${{ inputs.dry-run && '(DRY RUN)' || ''}}"
on:
workflow_dispatch:
inputs:
target-branch:
description: "Branch to release"
required: true
type: choice
default: 'development'
options:
- "development"
version:
description: "Version to release (e.g. 1.1.0 or 1.2.0-alpha1)"
required: true
type: string
dry-run:
description: "Dry run (skips remote operations)"
required: true
type: boolean
default: false
close-repository:
description: "Automatically close and release Maven Central staging repository (default true)"
required: true
type: boolean
default: true
jobs:
release:
name: Release
runs-on: ubuntu-latest

steps:
- uses: actions-cool/check-user-permission@main
id: checkUser
with:
username: ${{github.triggering_actor}}
check-contributor: true
require: 'write'
- name: Fail on workflow triggered by external contributor
if: ${{ steps.checkUser.outputs.require-result != 'true' }}
run: |
echo "🚫 **${{ github.actor }}** is an external contributor, only **${{ github.repository }}** team members can perform a release" \
| tee -a $GITHUB_STEP_SUMMARY && exit 1
- name: Validate Workflow branch
if: ${{ !github.event.inputs.dry-run }}
run: |
BRANCH_NAME=${GITHUB_REF##*/}
if [[ "development" != "${BRANCH_NAME}" ]]; then
echo "🚫 Release Workflow must be dispatched on 'development' branch." \
| tee -a $GITHUB_STEP_SUMMARY
exit 1
fi
- name: Checkout
uses: actions/checkout@v3
with:
ref: refs/heads/${{ inputs.target-branch }}
fetch-depth: 0

- name: Validate version
run: |
VERSION_REGEX='^[0-9]+\.[0-9]+\.[0-9]+(-(alpha|beta|rc)[0-9]+)?$'
if [[ ! "${{ inputs.version }}" =~ $VERSION_REGEX ]]; then
echo "🚫 Invalid version specified: '${{ inputs.version }}'. Please enter a valid SemVer version, like '1.2.3' or '1.0.0-alpha1'." \
| tee -a $GITHUB_STEP_SUMMARY
exit 1
fi
#if [[ "${{ inputs.target-branch }}" != "development" && ! "${{ inputs.version }}" = "${{ inputs.target-branch }}."* ]]; then
# echo "🚫 Invalid version specified: '${{ inputs.version }}' does not match the release branch '${{ inputs.target-branch }}'." \
# | tee -a $GITHUB_STEP_SUMMARY
# exit 1
#fi
if git rev-parse -q --verify "refs/tags/flow-${{ inputs.version }}" > /dev/null; then
echo "🚫 Version '${{ inputs.version }}' already exists. Please choose a different version." \
| tee -a $GITHUB_STEP_SUMMARY
exit 1
fi
echo "Releasing version '${{ inputs.version }}' from branch '${{ inputs.target-branch }}'." | tee -a $GITHUB_STEP_SUMMARY
if [[ "${{ github.event.inputs.dry-run }}" == "true" ]]; then
echo "⚠️ dry-run execution, artifacts will not be published on Maven Central." | tee -a $GITHUB_STEP_SUMMARY
fi
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Set version
run:
mvn -N -ntp versions:set -DnewVersion="${{ inputs.version }}"
- name: Staging artifacts
run: |
mvn -V -ntp -Prelease -DaltDeploymentRepository=local::file:./target/staging-deploy -DskipTests deploy
- name: Run JReleaser
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.MAVEN_GPG_PUBLIC }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
run: |
mvn -N -V -ntp -Prelease -Djreleaser.dry.run="${{ github.event.inputs.dry-run }}" -Dvertx-vaadin.release.closeRepository="${{ github.event.inputs.close-repository }}" -DskipTests jreleaser:full-release
- name: JReleaser release output
if: always()
uses: actions/upload-artifact@v3
with:
name: jreleaser-release
path: |
target/jreleaser/**
15 changes: 14 additions & 1 deletion .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
validation-required: ${{ steps.filter.outputs.validate }}
deploy-required: ${{ steps.filter.outputs.deploy }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -45,6 +46,18 @@ jobs:
filters: |
validate:
- '!(README.md|LICENSE|.gitignore|tools/**)'
deploy:
- 'pom.xml'
- 'vertx-vaadin-flow/pom.xml'
- 'vertx-vaadin-flow/src/**'
- 'vaadin-flow-sockjs/pom.xml'
- 'vaadin-flow-sockjs/src/**'
- 'vertx-vaadin-flow-jandex/pom.xml'
- 'vertx-vaadin-quarkus-extension/pom.xml'
- 'vertx-vaadin-quarkus-extension/runtime/pom.xml'
- 'vertx-vaadin-quarkus-extension/runtime/src/**'
- 'vertx-vaadin-quarkus-extension/deployment/pom.xml'
- 'vertx-vaadin-quarkus-extension/deployment/src/**'
build:
name: Build
needs: [changes]
Expand Down Expand Up @@ -282,7 +295,7 @@ jobs:
permissions:
contents: read
packages: write
if: ${{ success() && github.event_name == 'push' && github.ref_protected }}
if: ${{ success() && github.event_name == 'push' && github.ref_protected && needs.changes.outputs.deploy-required == 'true'}}
steps:
- uses: actions/checkout@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.vertx/

uber-pom.xml
.flattened-pom.xml
node_modules/
package.json
package-lock.json
Expand Down
63 changes: 40 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

![License](https://img.shields.io/github/license/mcollovati/vertx-vaadin.svg)
![Maven Central](https://img.shields.io/maven-central/v/com.github.mcollovati.vertx/vertx-vaadin-flow.svg?label=vertx-vaadin-flow)
![Repsy Snapshots](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Frepo.repsy.io%2Fmvn%2Fmcollovati%2Fvertx-vaadin-snapshots%2Fcom%2Fgithub%2Fmcollovati%2Fvertx%2Fvertx-vaadin-flow%2Fmaven-metadata.xml&label=repsy%20(snapshots))


## Description

Expand All @@ -18,7 +20,8 @@ This means you can mix the simplicity and robustness of Vaadin applications with
Vertx-vaadin binaries are available on Maven Central and Bintray.

### Maven
```

Stable artifacts are published on Maven Central.

```xml
<dependency>
Expand All @@ -28,38 +31,52 @@ Vertx-vaadin binaries are available on Maven Central and Bintray.
</dependency>
```


Snapshot are currently published on GitHub, so a [Personal Access Token](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry#authenticating-with-a-personal-access-token)
is required to download the artifacts
For better compatibility with Flow client, specific `vaadin-flow-sockjs` artifacts targeting exact Vaadin versions
in use are published using the `vaadin-${vaadin.version}` classifier.

```xml
<repository>
<id>vertx-vaadin-snapshots</id>
<url>https://maven.pkg.github.com/mcollovati/vertx-vaadin</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<dependency>
<groupId>com.github.mcollovati.vertx</groupId>
<artifactId>vaadin-flow-sockjs</artifactId>
<version>${vertx-vaadin-flow.version}</version>
<classifier>vaadin-${vaadin.version}</classifier>
</dependency>
```

In setting.xml
Snapshots and `vaadin-flow-sockjs` classifiers are currently published on [Repsy](https://repsy.io/).

```xml
<server>
<repositories>
<repository>
<id>vertx-vaadin</id>
<url>https://repo.repsy.io/mvn/mcollovati/vertx-vaadin</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>vertx-vaadin-snapshots</id>
<username>your username</username>
<password>PAT with read:packages</password>
</server>
<url>https://repo.repsy.io/mvn/mcollovati/vertx-vaadin-snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
```



## Compatibility matrix

| Vaadin version | Vert.x version | vertx-vaadin version |Status|
|----------------|--------------|--------------------------|------|
| 23.1.1 | 4.2.3 | vertx-vaadin-flow:23.1.x |[![CircleCI](https://circleci.com/gh/mcollovati/vertx-vaadin/tree/development.svg?style=svg)](https://circleci.com/gh/mcollovati/vertx-vaadin/tree/development)|
| 23.3 | 4.3 | vertx-vaadin-flow:23.3.x |[![CircleCI](https://circleci.com/gh/mcollovati/vertx-vaadin/tree/development.svg?style=svg)](https://circleci.com/gh/mcollovati/vertx-vaadin/tree/development)|
| Vaadin version | Vert.x version | vertx-vaadin version | Status |
|----------------|--------------|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 23.3 | 4.3 | vertx-vaadin-flow:23.4.x | ![Development](https://github.com/mcollovati/vertx-vaadin/actions/workflows/validation.yml/badge.svg?event=push&branch=development) |

## Documentation

Expand Down
Loading

0 comments on commit f07fbaa

Please sign in to comment.