diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7c0b601 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +name: Release + +# Run from the branch to release. On a maintenance branch, set `java-version` to the +# JDK the branch targets. +on: + workflow_dispatch: + inputs: + dry-run: + description: Dry run (release:prepare -DdryRun=true, nothing is pushed or deployed) + type: boolean + default: true + release-version: + description: Release version (leave empty for the default) + type: string + required: false + development-version: + description: Next development version (leave empty for the default) + type: string + required: false + +jobs: + release: + permissions: + contents: write + uses: FlowingCode/GithubActions/.github/workflows/maven-release.yml@main + with: + java-version: '17' + dry-run: ${{ inputs.dry-run }} + release-version: ${{ inputs.release-version }} + development-version: ${{ inputs.development-version }} + secrets: inherit + + # The release pushes the next development version with GITHUB_TOKEN, which does not + # trigger the Snapshot workflow, so the new snapshot is deployed from here. `ref` + # makes it build the branch head (the new SNAPSHOT version), not the commit the + # release was started from. + snapshot: + needs: release + if: ${{ !inputs.dry-run }} + permissions: + contents: read + packages: write + uses: FlowingCode/GithubActions/.github/workflows/maven-snapshot.yml@main + with: + java-version: '17' + ref: ${{ github.ref }} diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml new file mode 100644 index 0000000..b4ce1a5 --- /dev/null +++ b/.github/workflows/snapshot.yml @@ -0,0 +1,17 @@ +name: Snapshot + +# On a maintenance branch, set `branches` to that branch and `java-version` to the +# JDK the branch targets. +on: + push: + branches: [ "master" ] + workflow_dispatch: + +jobs: + snapshot: + permissions: + contents: read + packages: write + uses: FlowingCode/GithubActions/.github/workflows/maven-snapshot.yml@main + with: + java-version: '17' diff --git a/README.md b/README.md index 7ae6627..15cb4b7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/relative-time-add-on) [![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/relative-time-add-on.svg)](https://vaadin.com/directory/component/relative-time-add-on) -[![Build Status](https://jenkins.flowingcode.com/job/RelativeTime-addon/badge/icon)](https://jenkins.flowingcode.com/job/RelativeTime-addon) +[![Build Status](https://github.com/FlowingCode/RelativeTime/actions/workflows/maven.yml/badge.svg)](https://github.com/FlowingCode/RelativeTime/actions/workflows/maven.yml) [![Maven Central](https://img.shields.io/maven-central/v/com.flowingcode.vaadin.addons/relative-time-addon)](https://mvnrepository.com/artifact/com.flowingcode.vaadin.addons/relative-time-addon) [![Javadoc](https://img.shields.io/badge/javadoc-00b4f0)](https://javadoc.flowingcode.com/artifact/com.flowingcode.vaadin.addons/relative-time-addon) @@ -35,7 +35,7 @@ Add the following dependencies in your pom.xml file: ``` -Release versions are available from Maven Central repository. For SNAPSHOT versions see [here](https://maven.flowingcode.com/snapshots/). +Release versions are available from Maven Central repository. SNAPSHOT versions are published to [GitHub Packages](https://github.com/FlowingCode/RelativeTime/packages) (`https://maven.pkg.github.com/FlowingCode/RelativeTime`), which requires authenticating with a GitHub token that has the `read:packages` scope. ## Building and running demo