-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(release): create pre-release and release workflow (#75)
* ci(publish): add maven-publish and signing draft * ci(publish): add conventional commits draft with nyx * ci(reviewdog): only run during PR * ci(signing): local key test * build(signing): use in-memory keys * build(signing): use in-memory keys * build(release): update MavenPom properties * ci(espresso): add fusionauth docker compose for E2E testing * ci(e2e-testing-workflow): moved to a different branch * bumping version * docs: add "Release Process" section in README * docs: add quickstart update to the "Release Process" section * ci(release): add initial workflow * ci(pre-release): add initial workflow * refactor(kickstart): use correct styling * ci(release): add nexusPublishing draft * refactor(docker): remove version tag * feat(release): add nexus-actions to github workflow * nexus-actions/create-nexus-staging-repo * nexus-actions/release-nexus-staging-repo * nexus-actions/drop-nexus-staging-repo * ci(release): update NXRM_PROFILE_ID secret --------- Co-authored-by: Dan Moore <dan@fusionauth.io> Co-authored-by: Colin Frick <colin@frick.io>
- Loading branch information
1 parent
ce87629
commit adbc993
Showing
11 changed files
with
540 additions
and
220 deletions.
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,63 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
# This workflow performs a Maven Pre-Release | ||
# | ||
# Scans are triggered: | ||
# 1. On every push to default and protected branches | ||
# 2. On every Pull Request targeting the default branch | ||
# 3. On a weekly schedule | ||
# 4. Manually, on demand, via the "workflow_dispatch" event | ||
# | ||
|
||
name: Maven Pre-Release | ||
|
||
on: | ||
# Triggers the workflow on push or pull request events but only for default and protected branches | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+-*' | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "scan" | ||
scan: | ||
name: Maven Pre-Release | ||
|
||
permissions: | ||
# required for all workflows | ||
security-events: write | ||
# only required for workflows in private repositories | ||
actions: read | ||
contents: read | ||
|
||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Sets up JDK as a prerequisite to run Gradle | ||
- name: Setup Java | ||
uses: actions/setup-java@v4.2.1 | ||
with: | ||
java-version: '17' | ||
distribution: 'zulu' | ||
|
||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- name: Checkout repository | ||
uses: actions/checkout@v4.1.2 | ||
|
||
# Sets up Gradle as a prerequisite to run Maven Pre-Release | ||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3.1.0 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
# Performs a Local Maven Pre-Release | ||
- name: Run Maven Local Pre-Release | ||
env: | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_SIGNING_KEY }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_SIGNING_PASSWORD }} | ||
run: ./gradlew publishReleasePublicationToMavenLocal |
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,109 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
# This workflow performs a Maven Release | ||
# | ||
# Scans are triggered: | ||
# 1. On every push to default and protected branches | ||
# 2. On every Pull Request targeting the default branch | ||
# 3. On a weekly schedule | ||
# 4. Manually, on demand, via the "workflow_dispatch" event | ||
# | ||
|
||
name: Maven Release | ||
|
||
on: | ||
# Triggers the workflow on push or pull request events but only for default and protected branches | ||
push: | ||
branches: [ main ] | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]' | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "scan" | ||
create_staging_repository: | ||
runs-on: ubuntu-latest | ||
name: Create staging repository | ||
outputs: | ||
repository_id: ${{ steps.create.outputs.repository_id }} | ||
steps: | ||
- id: create | ||
uses: nexus-actions/create-nexus-staging-repo@main | ||
with: | ||
username: ${{ secrets.NXRM_TOKEN_USERNAME }} | ||
password: ${{ secrets.NXRM_TOKEN_PASSWORD }} | ||
staging_profile_id: ${{ secrets.NXRM_PROFILE_ID }} | ||
description: ${{ github.repository }}/${{ github.workflow }}#${{ github.run_number }} | ||
|
||
publish: | ||
name: Maven Release | ||
|
||
permissions: | ||
# required for all workflows | ||
security-events: write | ||
# only required for workflows in private repositories | ||
actions: read | ||
contents: read | ||
|
||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Sets up JDK as a prerequisite to run Gradle | ||
- name: Setup Java | ||
uses: actions/setup-java@v4.2.1 | ||
with: | ||
java-version: '17' | ||
distribution: 'zulu' | ||
|
||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- name: Checkout repository | ||
uses: actions/checkout@v4.1.2 | ||
|
||
# Sets up Gradle as a prerequisite to run Maven Release | ||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3.1.0 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
|
||
# Performs a Local Maven Release | ||
- name: Run Maven Local Release | ||
env: | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_SIGNING_KEY }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_SIGNING_PASSWORD }} | ||
run: ./gradlew publishReleasePublicationToMavenLocal | ||
|
||
# Performs a Maven Release to oss.sonatype.org | ||
- name: Run Maven Release to OSSRH | ||
env: | ||
ossrhUsername: ${{ secrets.NXRM_TOKEN_USERNAME }} | ||
ossrhPassword: ${{ secrets.NXRM_TOKEN_PASSWORD }} | ||
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.NXRM_TOKEN_USERNAME }} | ||
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.NXRM_TOKEN_PASSWORD }} | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_SIGNING_KEY }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_SIGNING_PASSWORD }} | ||
run: ./gradlew clean publishReleasePublicationToOSSRHRepository | ||
|
||
finalize: | ||
runs-on: ubuntu-latest | ||
needs: [create_staging_repository,publish] | ||
if: ${{ always() && needs.create_staging_repository.result == 'success' }} | ||
steps: | ||
- name: Discard | ||
if: ${{ needs.publish.result != 'success' }} | ||
uses: nexus-actions/drop-nexus-staging-repo@main | ||
with: | ||
username: ${{ secrets.NXRM_TOKEN_USERNAME }} | ||
password: ${{ secrets.NXRM_TOKEN_PASSWORD }} | ||
staging_repository_id: ${{ needs.create_staging_repository.outputs.repository_id }} | ||
- name: Release | ||
if: ${{ needs.publish.result == 'success' }} | ||
uses: nexus-actions/release-nexus-staging-repo@main | ||
with: | ||
username: ${{ secrets.NXRM_TOKEN_USERNAME }} | ||
password: ${{ secrets.NXRM_TOKEN_PASSWORD }} | ||
staging_repository_id: ${{ needs.create_staging_repository.outputs.repository_id }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Oops, something went wrong.