Skip to content

Merge branch 'main' of https://github.com/BesLogic/releaf-genparker #249

Merge branch 'main' of https://github.com/BesLogic/releaf-genparker

Merge branch 'main' of https://github.com/BesLogic/releaf-genparker #249

name: genparker-pipeline
on:
push:
branches:
- "main"
env:
BEFORE_SHA: ${{ github.event.before }}
DOCKER_ENVIRONMENT: "latest"
ORG_GRADLE_PROJECT_RELEAF_UPLOAD_STORE_PASSWORD: ${{ secrets.RELEAF_UPLOAD_STORE_PASSWORD }}
ORG_GRADLE_PROJECT_RELEAF_UPLOAD_KEY_PASSWORD: ${{ secrets.RELEAF_UPLOAD_KEY_PASSWORD }}
RELEAF_GENPARKER_KEYS: ${{ secrets.RELEAF_GENPARKER_KEYS }}
jobs:
init:
runs-on: ubuntu-latest
outputs:
environment: ${{ steps.setvars.outputs.environment }}
branch: ${{ steps.setvars.outputs.branch }}
steps:
- name: Set variables
id: setvars
run: |
echo "::set-output name=environment::production"
echo "::set-output name=branch::main"
prepare-fe:
runs-on: ubuntu-latest
needs: init
steps:
- uses: BesLogic/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: publish affected
run: npx nx affected --target=publish-fe --head=${{needs.init.outputs.branch}} --base=$BEFORE_SHA --configuration=${{needs.init.outputs.environment }} --parallel=5
prepare-be:
runs-on: ubuntu-latest
needs: init
steps:
- uses: BesLogic/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: publish affected
run: npx nx affected --target=publish --head=${{needs.init.outputs.branch}} --base=$BEFORE_SHA --configuration=${{needs.init.outputs.environment }} --parallel=5
- name: "cp for kustomize"
run: |
cp -r configs/genparker/base configs/genparker/overlay/philantropy/base & \
cp configs/genparker/overlay/kustomization.yml configs/genparker/overlay/philantropy
- name: "Kustomize Build"
uses: int128/kustomize-action@v1
id: kustomize
with:
kustomization: "overlay/*/kustomization.yml"
base-directory: "configs/genparker"
- run: cp -r ${{ steps.kustomize.outputs.directory }} deployment_configs
- name: Update with kustomize
run: |
git add -A
git config --global user.name 'GenParker'
git config --global user.email '[email protected]'
git commit -am "Updating the project's structure"
git push -f origin main:deployment/philantropy
prepare-mobile:
runs-on: ubuntu-latest
needs: init
steps:
- uses: BesLogic/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies Mobile
run: cd apps/releaf/mobile && npm i --ignore-scripts
- uses: actions/setup-java@v4
with:
distribution: "microsoft"
java-version: "17"
- name: Set up Android SDK
uses: android-actions/setup-android@v2
with:
api-level: 34
target: default
channel: stable
- name: get file
run: |
curl -o ./apps/releaf/mobile/android/app/releaf.keystore -H "Authorization: token ${RELEAF_GENPARKER_KEYS}" https://raw.githubusercontent.com/andy2great/releaf-genparker-keys/main/releaf.keystore
- name: publish affected
run: npx nx affected --target=build-mobile --head=${{needs.init.outputs.branch}} --base=$BEFORE_SHA --configuration=${{needs.init.outputs.environment}} --parallel=5
- uses: r0adkll/upload-google-play@v1
if: ${{ hashFiles('apps/releaf/mobile/android/app/build/outputs/bundle/release/app-release.aab') != '' }}
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.release
releaseFiles: apps/releaf/mobile/android/app/build/outputs/bundle/release/app-release.aab
track: alpha
status: completed
inAppUpdatePriority: 2