-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
88c7f11
commit ce82001
Showing
2 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# sets up java, maven and gpg | ||
# sets up settings.xml in such a way that the build/deploy works | ||
# releases the project with specified version | ||
# deploys it to the sonatype staging repo | ||
name: Release and deploy to Sonatype staging repo | ||
|
||
env: | ||
GITHUB_PAT: ${{ secrets.QUDTLIB_BOT_GITHUB_TOKEN }} | ||
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | ||
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release_version: | ||
description: 'Release version (such as 2.3.13)' | ||
required: true | ||
type: string | ||
next_snapshot_version: | ||
description: 'Next SNAPSHOT version (such as 2.4-SNAPSHOT)' | ||
required: true | ||
type: string | ||
environment: | ||
description: 'Environment to run tests against' | ||
type: environment | ||
required: true | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
- name: Set up Apache Maven Central | ||
uses: actions/setup-java@v3 | ||
with: # running setup-java again overwrites the settings.xml | ||
distribution: 'temurin' | ||
java-version: '11' | ||
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml | ||
server-username: MAVEN_USERNAME # env variable for username in deploy | ||
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy | ||
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: setup git config | ||
run: | | ||
git config user.name ${{ github.actor }} | ||
git config user.email "<>" | ||
- name: Build with Maven, deploying to sonatype staging repo | ||
run: mvn -B release:clean release:prepare release:perform -Dpassword=$GITHUB_PAT -Dproject.version=${{ inputs.release_version }} -DdevelopmentVersion=${{ inputs.next_snapshot_version }} -Dgpg.passphrase=$MAVEN_GPG_PASSPHRASE | ||
- name: Print summary | ||
run: echo "Release ${{ inputs.release_version }} deployed to sonatype staging repo. Please go there, close the repo and publish it." >> $GITHUB_STEP_SUMMARY |
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