Release to Alpha by @choidongjune #7
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 Codepush Alpha Environment' | |
run-name: Release to Alpha by @${{ github.actor }} | |
permissions: | |
contents: write | |
pull-requests: write | |
on: workflow_dispatch | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
APP_CENTER_TOKEN: ${{ secrets.APP_CENTER_TOKEN }} | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node 18.16.x | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18.16.x' | |
cache: 'yarn' | |
env: | |
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
- name: Set Yarn Version | |
id: set-version | |
run: | | |
yarn set version 3.6.4 | |
echo "YARN_VERSION=$(yarn -v)" >> $GITHUB_OUTPUT | |
env: | |
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} | |
- name: Get cache dir path | |
id: yarn-cache-dir-path | |
run: echo "CACHE_DIR=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
- name: Yarn cache | |
uses: actions/cache@v2 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.CACHE_DIR }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ steps.set-version.outputs.YARN_VERSION }} | |
restore-keys: | | |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}- | |
- name: Install dependencies | |
run: | | |
CACHE_HIT="${{ steps.yarn-cache.outputs.cache-hit }}" | |
NODE_MODULES_EXISTS=$(test -d "node_modules" && echo "true" || echo "false") | |
if [[ "$CACHE_HIT" != 'true' || "$NODE_MODULES_EXISTS" == 'false' ]]; then | |
yarn install | |
fi | |
- name: Install Appcenter CLI | |
run: npm install -g appcenter-cli | |
- name: Login to Appcenter | |
run: appcenter login --token ${{ env.APP_CENTER_TOKEN }} | |
env: | |
APP_CENTER_TOKEN: ${{ env.APP_CENTER_TOKEN }} | |
- name: Deploy to Codepush | |
run: yarn codepush:ios && yarn codepush:android | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
commit-message: Release to Alpha | |
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | |
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> | |
signoff: false | |
title: 'Release to Alpha' | |
body: | | |
# Release to Alpha | |
- Auto-generated by [create-pull-request][1] | |
assignees: ${{ github.actor }} | |
branch: develop | |
# - name: Merge publish to main | |
# run: | | |
# git config user.name "${{ github.actor }}" | |
# git config user.email "${{ github.actor }}@users.noreply.github.com" | |
# git checkout main | |
# git merge --no-ff --no-edit develop | |
# git push origin main |