-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (75 loc) · 3.21 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: PBRP Organization CI
on:
workflow_dispatch:
inputs:
DEPLOY_TYPE:
description: 'Deploy Type (TEST/BETA/OFFICIAL)'
required: true
default: 'TEST'
Vendor:
description: 'Enter Device OEM Name'
required: true
CodeName:
description: 'Enter Device Code Name'
required: true
Branch:
description: 'Enter bootable/recovery Branch'
required: true
Link:
description: 'Enter Direct Download Link'
required: true
DtLink:
description: 'Enter Device Tree Link (From PBRP Org)'
required: true
ChangeLogs:
description: 'Build ChangeLogs'
required: true
default: 'Sync Latest Source'
env:
BUILD_RELEASE_TYPE: ${{ github.event.inputs.DEPLOY_TYPE }}
VENDOR: ${{ github.event.inputs.Vendor }}
CODENAME: ${{ github.event.inputs.CodeName }}
BRANCH: ${{ github.event.inputs.Branch }}
LINK: ${{ github.event.inputs.Link }}
DTLINK: ${{ github.event.inputs.DtLink }}
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 }}
jobs:
PBRP_CI:
if: "(! contains(toJSON(github.event.commits.*.message), '[skip-ci]'))"
runs-on: ubuntu-20.04
steps:
- 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
echo "WorkPath=/home/runner/workspace" >> ${GITHUB_ENV}
echo "DLPATH=/home/runner/workspace/out/target/product/$CODENAME" >> ${GITHUB_ENV}
- name: Download Build
run: |
mkdir -p $WorkPath && cd $WorkPath
git clone https://github.com/PitchBlackRecoveryProject/android_bootable_recovery -b $BRANCH --single-branch bootable/recovery
git clone https://github.com/PitchBlackRecoveryProject/DeployBuild DeployBuild
git clone https://github.com/PitchBlackRecoveryProject/vendor_utils vendor/utils
git clone $DTLINK device/$VENDOR/$CODENAME
mkdir -p $DLPATH && cd $DLPATH
wget $LINK
unzip -j *.zip *.img
- name: Installing GHR
run: |
cd /home/runner
curl -s https://api.github.com/repos/tcnksm/ghr/releases/latest | jq -r '.assets[] | select(.browser_download_url | contains("linux_amd64")) | .browser_download_url' | wget -qi -
tar -xzf ghr_*_amd64.tar.gz --wildcards 'ghr*/ghr' --strip-components 1 && rm -rf ghr_*_amd64.tar.gz
chmod a+x ./ghr && sudo mv ./ghr /usr/local/bin/
- name: Release Build
run: |
sudo apt-get update && sudo apt-get install sshpass -y
cd $WorkPath
bash DeployBuild/pb_deploy.sh ${BUILD_RELEASE_TYPE} ${VENDOR} ${CODENAME}