Release #27
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
name: "Release" | |
on: | |
workflow_dispatch: | |
inputs: | |
dryRun: | |
description: "Do a dry run to preview instead of a real release [true/false]" | |
required: true | |
default: "true" | |
jobs: | |
# SDK release is done from public main branch. | |
confirm-public-repo-main-branch: | |
name: "Confirm release is run from public/main branch" | |
uses: mParticle/mparticle-workflows/.github/workflows/sdk-release-repo-branch-check.yml@main | |
unit-test: | |
name: "Unit Tests" | |
needs: confirm-public-repo-main-branch | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout Branch" | |
uses: actions/checkout@v3 | |
- name: "Install JDK 11" | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "zulu" | |
java-version: "11" | |
cache: "gradle" | |
- name: "Run Tests" | |
run: ./gradlew test | |
semantic-release: | |
name: "Semantic Release" | |
needs: unit-test | |
runs-on: macos-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }} | |
GIT_AUTHOR_NAME: mparticle-bot | |
GIT_AUTHOR_EMAIL: developers@mparticle.com | |
GIT_COMMITTER_NAME: mparticle-bot | |
GIT_COMMITTER_EMAIL: developers@mparticle.com | |
steps: | |
- name: "Checkout Branch" | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }} | |
fetch-depth: 0 | |
ref: main | |
- name: "Import GPG Key" | |
uses: crazy-max/ghaction-import-gpg@v5 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
git_user_signingkey: true | |
git_commit_gpgsign: true | |
- name: "Semantic Release --dry-run" | |
if: ${{ github.event.inputs.dryRun == 'true' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }} | |
GIT_AUTHOR_NAME: mparticle-bot | |
GIT_AUTHOR_EMAIL: developers@mparticle.com | |
GIT_COMMITTER_NAME: mparticle-bot | |
GIT_COMMITTER_EMAIL: developers@mparticle.com | |
run: | | |
npx \ | |
-p lodash \ | |
-p semantic-release@17 \ | |
-p @semantic-release/changelog@5 \ | |
-p @semantic-release/git@9 \ | |
-p @semantic-release/exec@5 \ | |
semantic-release --dry-run | |
- name: "Semantic Release" | |
if: ${{ github.event.inputs.dryRun == 'false' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.MP_SEMANTIC_RELEASE_BOT }} | |
GIT_AUTHOR_NAME: mparticle-bot | |
GIT_AUTHOR_EMAIL: developers@mparticle.com | |
GIT_COMMITTER_NAME: mparticle-bot | |
GIT_COMMITTER_EMAIL: developers@mparticle.com | |
run: | | |
npx \ | |
-p lodash \ | |
-p semantic-release@17 \ | |
-p @semantic-release/changelog@5 \ | |
-p @semantic-release/git@9 \ | |
-p @semantic-release/exec@5 \ | |
-p conventional-changelog-conventionalcommits@7 \ | |
semantic-release | |
sonatype-release: | |
name: "Sonatype Release" | |
needs: semantic-release | |
runs-on: ubuntu-latest | |
env: | |
sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} | |
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} | |
mavenSigningKeyId: ${{ secrets.MAVEN_CENTRAL_SIGNING_KEY }} | |
mavenSigningKeyPassword: ${{ secrets.MAVEN_CENTRAL_SIGNING_KEY_PASSWORD }} | |
steps: | |
- name: "Checkout Branch" | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
- name: "Install JDK 11" | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "zulu" | |
java-version: "11" | |
cache: "gradle" | |
- name: "Publish" | |
if: ${{ github.event.inputs.dryRun == 'false'}} | |
run: | | |
./gradlew uploadArchives -Ptarget_maven_repo=sonatype --daemon --info | |