generated from netty-contrib/template-multi
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
22 additions
and
223 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,85 +3,26 @@ on: | |
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'The version being released (pom.xml files will be updated)' | ||
required: true | ||
description: 'The version being released (pom.xml files will be updated) - leave empty for Maven default' | ||
required: false | ||
type: string | ||
default: '' | ||
netty: | ||
description: 'The version range to use for the Netty Core dependencies' | ||
description: 'The version range to use for the Netty Core dependencies - will use value from pom.xml if empty' | ||
required: false | ||
type: string | ||
default: '' | ||
java-version: | ||
description: 'The version of Java to use for building' | ||
required: false | ||
default: '(5.0,)' | ||
type: string | ||
default: '11' | ||
|
||
jobs: | ||
Build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out project | ||
uses: actions/checkout@v2 | ||
|
||
# Configure Java | ||
- uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'adopt' | ||
java-version: '11' | ||
cache: 'maven' | ||
|
||
- name: Import GPG key | ||
id: import_gpg | ||
uses: crazy-max/ghaction-import-gpg@v3 | ||
with: | ||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "Netty Project Bot on behalf of ${{ github.actor }}" | ||
git config user.email "[email protected]" | ||
- name: Configure Maven Release Repository | ||
uses: s4u/maven-settings-action@v2 | ||
with: | ||
servers: | | ||
[{ | ||
"id": "sonatype-nexus", | ||
"username": "${{ secrets.SONATYPE_USERNAME }}", | ||
"password": "${{ secrets.SONATYPE_PASSWORD }}" | ||
}] | ||
# See https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#setting-an-environment-variable | ||
- name: Inspect Project | ||
run: | | ||
echo "netty_snapshot=$(mvn help:evaluate -Dexpression=netty.version -q -DforceStdout)" >> $GITHUB_ENV | ||
echo "tag=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)-${{ github.event.inputs.version }}" >> $GITHUB_ENV | ||
- name: Set Netty Core Version | ||
run: | | ||
mvn versions:set-property -Dproperty=netty.version '-DnewVersion=${{ github.event.inputs.netty }}' | ||
- name: Verify Build | ||
run: | | ||
mvn clean install -B -ntp -DperformRelease | ||
- name: Update versions for release | ||
run: | | ||
git add . | ||
git commit -m 'Update versions for release' | ||
- name: Prepare release with Maven | ||
run: mvn -B -ntp --file pom.xml release:prepare -DpreparationGoals=clean -DskipTests '-DreleaseVersion=${{ github.event.inputs.version }}' '-Dtag=${{ env.tag }}' -Drelease.gpg.keyname=${{ secrets.GPG_KEYNAME }} -Drelease.gpg.passphrase=${{ secrets.GPG_PASSPHRASE }} | ||
|
||
- name: Perform release with Maven | ||
run: mvn -B -ntp --file pom.xml release:perform -Drelease.gpg.keyname=${{ secrets.GPG_KEYNAME }} -Drelease.gpg.passphrase=${{ secrets.GPG_PASSPHRASE }} | ||
|
||
- name: Prepare for next development version | ||
run: | | ||
mvn versions:set-property -Dproperty=netty.version '-DnewVersion=${{ env.netty_snapshot }}' | ||
mvn versions:commit | ||
git add . | ||
git commit -m 'Update versions for development' | ||
git push --tags | ||
- name: Rollback release on failure | ||
if: ${{ failure() }} | ||
# Rollback the release in case of an failure | ||
run: | | ||
mvn -B -ntp --file pom.xml release:rollback | ||
git push origin :"${{ env.tag }}" | ||
Release: | ||
uses: netty-contrib/.github/.github/workflows/release.yml@main | ||
with: | ||
version: ${{ inputs.version }} | ||
netty: ${{ inputs.netty }} | ||
java-version: ${{ inputs.java-version }} | ||
secrets: inherit |