From a1d6fc735f79fe4cec97d9289e44d90204c12d1e Mon Sep 17 00:00:00 2001 From: Satham Hussain M <52215963+SathamHussainM@users.noreply.github.com> Date: Tue, 30 Jan 2024 19:09:43 +0530 Subject: [PATCH] Create pbrp-organization-ci.yml --- .github/workflows/pbrp-organization-ci.yml | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/pbrp-organization-ci.yml diff --git a/.github/workflows/pbrp-organization-ci.yml b/.github/workflows/pbrp-organization-ci.yml new file mode 100644 index 0000000..24b4786 --- /dev/null +++ b/.github/workflows/pbrp-organization-ci.yml @@ -0,0 +1,71 @@ +name: PBRP Organization CI +on: + workflow_dispatch: + inputs: + DEPLOY_TYPE: + description: 'Deploy Type (TEST/BETA/OFFICIAL)' + required: true + default: 'TEST' + ChangeLogs: + description: 'Build ChangeLogs' + required: true + default: 'Sync Latest Source' + +env: + BUILD_RELEASE_TYPE: ${{ github.event.inputs.DEPLOY_TYPE }} + CHANGELOG: ${{ github.event.inputs.ChangeLogs }} + BOT_API: ${{ secrets.BOT_API }} + GCF_AUTH_KEY: ${{ secrets.GCF_AUTH_KEY }} + GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }} + GitHubMail: ${{ secrets.GitHubMail }} + GitHubName: ${{ secrets.GitHubName }} + SFPassword: ${{ secrets.SFPassword }} + SFUserName: ${{ secrets.SFUserName }} + TARGET: "pbrp" + #EXTRA_CMD: "Extra Commands Here" + +jobs: + PBRP_CI: + if: "(! contains(toJSON(github.event.commits.*.message), '[skip-ci]'))" + runs-on: ubuntu-20.04 + + steps: + - name: Auto Adapt Manifest + # /* if your branch name is other than the one which you dispatched workflow from then set it manually in the place of ${GITHUB_REF##*/}" */ + run: echo "MANIFEST=https://github.com/PitchBlackRecoveryProject/manifest_pb -b ${GITHUB_REF##*/}" >> $GITHUB_ENV + + - name: Export Vars + run: | + if [[ ${BUILD_RELEASE_TYPE} == "TEST" ]]; then echo "TEST_BUILD=true" >> $GITHUB_ENV;fi + if [[ ${BUILD_RELEASE_TYPE} == "BETA" ]]; then echo "BETA_BUILD=true" >> $GITHUB_ENV;fi + if [[ ${BUILD_RELEASE_TYPE} == "OFFICIAL" ]]; then echo "PB_OFFICIAL=true" >> $GITHUB_ENV;fi + + - name: Checkout Cleaning Up Runner Repo + uses: actions/checkout@v2 + with: + repository: PitchBlackRecoveryProject/Cleaner + ref: main + token: ${{ secrets.GH_BOT_TOKEN }} + path: .github/actions/Cleaner + - name: Cleaning + uses: ./.github/actions/Cleaner + - name: Set Swap Space + uses: pierotofy/set-swap-space@master + with: + swap-size-gb: 12 + + - name: Checkout Recovery Compiler Repo + uses: actions/checkout@v2 + with: + repository: PitchBlackRecoveryProject/Compiler + ref: production + token: ${{ secrets.GH_BOT_TOKEN }} + path: .github/actions/Compiler + - name: Recovery Compilation + uses: ./.github/actions/Compiler + + - name: Release Builds + run: | + sudo apt-get update && sudo apt-get install sshpass -y + cd $BuildPath + bash vendor/utils/pb_deploy.sh ${BUILD_RELEASE_TYPE} ${VENDOR} ${CODENAME}