Release #171
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' | |
required: true | |
default: 'true' | |
jobs: | |
authorize: | |
name: Authorize | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: ${{ github.actor }} permission check to do a release | |
uses: "lannonbr/[email protected]" | |
with: | |
permission: "write" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run-tests: | |
name: Run Tests | |
uses: ./.github/workflows/pull-request-test.yml | |
release: | |
name: Release | |
runs-on: ubuntu-20.04 | |
needs: [authorize, run-tests] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'zulu' | |
cache: 'gradle' | |
- name: Configure GPG | |
env: | |
GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }} | |
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }} | |
run: | | |
sudo bash -c "echo '$GPG_KEY_CONTENTS' | base64 -d > '$SIGNING_SECRET_KEY_RING_FILE'" | |
- name: Configure Sonatype | |
env: | |
GRADLE_PROP_FILE: local.properties | |
run: | | |
echo "ossrhUsername=${{ secrets.OSSRH_USERNAME }}" >> $GRADLE_PROP_FILE | |
echo "ossrhPassword=${{ secrets.OSSRH_PASSWORD }}" >> $GRADLE_PROP_FILE | |
echo "sonatypeStagingProfileId=${{ secrets.SONATYPE_STAGING_PROFILE_ID }}" >> $GRADLE_PROP_FILE | |
echo "signing.keyId=${{ secrets.SIGNING_KEY_ID }}" >> $GRADLE_PROP_FILE | |
echo "signing.password=${{ secrets.SIGNING_PASSWORD }}" >> $GRADLE_PROP_FILE | |
echo "signing.secretKeyRingFile=${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}" >> $GRADLE_PROP_FILE | |
- name: Semantic Release --dry-run | |
if: ${{ github.event.inputs.dryRun == 'true'}} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GIT_AUTHOR_NAME: amplitude-sdk-bot | |
GIT_AUTHOR_EMAIL: [email protected] | |
GIT_COMMITTER_NAME: amplitude-sdk-bot | |
GIT_COMMITTER_EMAIL: [email protected] | |
run: | | |
npx \ | |
-p lodash \ | |
-p semantic-release@17 \ | |
-p @semantic-release/changelog@5 \ | |
-p @semantic-release/git@9 \ | |
-p @google/[email protected] \ | |
-p @semantic-release/exec@5 \ | |
semantic-release --dry-run | |
- name: Semantic Release | |
if: ${{ github.event.inputs.dryRun == 'false'}} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GIT_AUTHOR_NAME: amplitude-sdk-bot | |
GIT_AUTHOR_EMAIL: [email protected] | |
GIT_COMMITTER_NAME: amplitude-sdk-bot | |
GIT_COMMITTER_EMAIL: [email protected] | |
run: | | |
npx \ | |
-p lodash \ | |
-p semantic-release@17 \ | |
-p @semantic-release/changelog@5 \ | |
-p @semantic-release/git@9 \ | |
-p @google/[email protected] \ | |
-p @semantic-release/exec@5 \ | |
semantic-release |