Skip to content

Commit

Permalink
feat: implement workflow_dispatch version
Browse files Browse the repository at this point in the history
  • Loading branch information
eudiwtech committed Jan 15, 2025
1 parent b8eb0da commit 199397f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 22 deletions.
16 changes: 7 additions & 9 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@ runs:
shell: bash
run: corepack enable
- id: setup-node
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version-file: '.node-version'
- id: yarn-cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
env:
cache-name: cache-node-modules
with:
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
- id: install-packages
run: yarn install --frozen-lockfile
shell: bash
48 changes: 35 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
name: Build and Deploy

on:
push:
branches:
- main
workflow_dispatch:
inputs:
releaseLevel:
description: 'Version to bump'
required: true
type: choice
default: minor
options:
- major
- minor
- patch

jobs:
run-static-checks:
Expand Down Expand Up @@ -38,7 +46,20 @@ jobs:
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
yarn start-fix-cycle
if [[ ${{ github.event.inputs.releaseLevel }} == "major" ]]; then
echo "Bumping the major version"
yarn start-breaking-cycle
elif [[ ${{ github.event.inputs.releaseLevel }} == "minor" ]]; then
echo "Bumping the minor version"
yarn start-release-cycle
elif [[ ${{ github.event.inputs.releaseLevel }} == "patch" ]]; then
echo "Bumping the patch version"
yarn start-fix-cycle
else
echo "Unknown release level: ${{ github.event.inputs.releaseLevel }}"
exit 1
fi
- id: push-tags
run: |
git push --no-verify --follow-tags origin HEAD:${GITHUB_REF#refs/heads/}
Expand All @@ -50,26 +71,27 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-android:
needs: run-static-checks
needs: bump-app-version
environment: prod
runs-on: ubuntu-latest
steps:
- id: checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab #v3.5.2
with:
fetch-depth: 0
ref: ${{ needs.bump-app-version.outputs.currentAppVersion }}
- id: setup
uses: ./.github/actions/setup
- id: setup-jdk
- id: setup-jdk-17
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 #v3.11.0
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
cache: gradle
- id: setup-android-sdk
uses: android-actions/setup-android@7c5672355aaa8fde5f97a91aa9a99616d1ace6bc #v2.0.10
uses: android-actions/setup-android@00854ea68c109d98c75d956347303bf7c45b0277 #v3.2.1
- id: setup-ruby
uses: ruby/setup-ruby@d2b39ad0b52eca07d23f3aa14fdf2a3fcc1f411c #v1.149.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf #v1.204.0
with:
bundler-cache: true
- id: build-release-android
Expand All @@ -78,15 +100,15 @@ jobs:
cd android && bundle exec fastlane alpha
shell: bash
env:
RUBYOPT: '-rostruct'
RUBYOPT: '-rostruct' # TODO: Remove when https://github.com/fastlane/fastlane/pull/21950 gets released
ENCODED_IOAPP_JSON_KEY_FILE: ${{secrets.ENCODED_IOAPP_JSON_KEY_FILE}}
ENCODED_IO_APP_RELEASE_KEYSTORE: ${{secrets.ENCODED_IO_APP_RELEASE_KEYSTORE}}
IO_APP_RELEASE_STORE_FILE: ${{secrets.IO_APP_RELEASE_STORE_FILE}}
IO_APP_RELEASE_STORE_PASSWORD: ${{secrets.IO_APP_RELEASE_STORE_PASSWORD}}
IO_APP_RELEASE_KEY_ALIAS: ${{secrets.IO_APP_RELEASE_KEY_ALIAS}}
IO_APP_RELEASE_KEY_PASSWORD: ${{secrets.IO_APP_RELEASE_KEY_PASSWORD}}
release-ios:
needs: run-static-checks
needs: bump-app-version
environment: prod
runs-on: macos-14
steps:
Expand All @@ -100,7 +122,7 @@ jobs:
- id: setup
uses: ./.github/actions/setup
- id: setup-ruby
uses: ruby/setup-ruby@22fdc77bf4148f810455b226c90fb81b5cbc00a7 #v1.171.0
uses: ruby/setup-ruby@401c19e14f474b54450cd3905bb8b86e2c8509cf #v1.204.0
with:
bundler-cache: true
- id: prepare-ios-build
Expand Down

0 comments on commit 199397f

Please sign in to comment.