Chore: release #7
Workflow file for this run
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: | |
pull_request: | |
types: | |
- closed | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
Release: | |
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/create-github-app-token@v1 | |
id: app-token | |
with: | |
app-id: ${{ vars.PUBLIVERSIONER_ID }} | |
private-key: ${{ secrets.PUBLIVERSIONER_SECRET }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
env: | |
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'zulu' | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
- name: Bump version | |
run: yarn workspace @rn-demo-app/app version patch | |
- name: Build Android app | |
run: yarn workspace @rn-demo-app/app run android --mode=release | |
- name: Commit changes | |
if: ${{ !cancelled() }} | |
id: committer | |
uses: EndBug/add-and-commit@v9 | |
env: | |
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
with: | |
default_author: github_actions | |
author_email: github-bot@rees46.com | |
message: 'chore(common): version bump' | |
add: '["*.json"]' | |
- name: Create Release | |
if: ${{ !cancelled() && steps.committer.outputs.committed == 'true' }} | |
working-directory: ./rn-demo-app/app | |
env: | |
GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
run: | | |
yarn exec 'bash -c \ | |
"VERSION=\$npm_package_version; \ | |
gh release create \"\$VERSION\" ./android/app/build/outputs/apk/release/app-release.apk ;"' |