Release #39
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-latest | |
steps: | |
- name: ${{ github.actor }} permission check to do a release | |
uses: octokit/request-action@v2.x | |
with: | |
route: GET /repos/:repository/collaborators/${{ github.actor }} | |
repository: ${{ github.repository }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: [authorize] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Java 8 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '8' | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Lint | |
run: ./gradlew ktlintCheck | |
- name: Build | |
run: ./gradlew assemble | |
- name: Test | |
run: ./gradlew test --info | |
- 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: amplitude-sdk-bot@users.noreply.github.com | |
GIT_COMMITTER_NAME: amplitude-sdk-bot | |
GIT_COMMITTER_EMAIL: amplitude-sdk-bot@users.noreply.github.com | |
run: | | |
npx \ | |
-p lodash \ | |
-p semantic-release \ | |
-p @semantic-release/changelog \ | |
-p @semantic-release/git \ | |
-p @google/semantic-release-replace-plugin \ | |
-p @semantic-release/exec \ | |
semantic-release --dry-run | |
- name: Semantic Release | |
if: ${{ github.event.inputs.dryRun == 'false'}} | |
env: | |
# Github | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GIT_AUTHOR_NAME: amplitude-sdk-bot | |
GIT_AUTHOR_EMAIL: amplitude-sdk-bot@users.noreply.github.com | |
GIT_COMMITTER_NAME: amplitude-sdk-bot | |
GIT_COMMITTER_EMAIL: amplitude-sdk-bot@users.noreply.github.com | |
# Sonatype Publishing | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} | |
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
run: | | |
npx \ | |
-p lodash \ | |
-p semantic-release \ | |
-p @semantic-release/changelog \ | |
-p @semantic-release/git \ | |
-p @google/semantic-release-replace-plugin \ | |
-p @semantic-release/exec \ | |
semantic-release |