forked from bczhc/some-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (57 loc) · 1.8 KB
/
Copy pathandroid.yml
File metadata and controls
66 lines (57 loc) · 1.8 KB
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
name: Android CI
on:
push:
branches: [ '**' ]
pull_request:
branches: [ '**' ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install requirements
run: |
sudo apt install ruby -y
- name: Configure SSH key
env:
SSH_PRK: ${{ secrets.SSH_PRK }}
run: |
if [ ! -d ~/.ssh ]; then
mkdir ~/.ssh
fi
ssh-keyscan gitlab.com 2> /dev/null >> ~/.ssh/known_hosts
echo $SSH_PRK | base64 -d > ~/.ssh/id_rsa
sudo chmod 600 ~/.ssh/id_rsa
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
- name: Build app
run: |
docker build . -t some-tools-build
docker run --name some-tools some-tools-build
docker cp some-tools:/apks .
- name: Upload apk to GitLab
run: |
cd "${GITHUB_WORKSPACE}"
encoded_commit_info=`git log --no-decorate --max-count=1 | base64 -w 0`
commit_hash=`git log --format=%H | head -n1`
git clone git@gitlab.com:bczhc/store
cd store
rm -rf .git
git init
git remote add origin git@gitlab.com:bczhc/store
mkdir -p apks/some-tools 2> /dev/null || true
cd ..
tools/store-apk apks/release store/apks/some-tools $commit_hash $encoded_commit_info
cd store
git config --global user.email "<>"
git config --global user.name "github-actions-bot"
git add --all
git commit -m "update $(date)"
git push origin master -f
cd "${GITHUB_WORKSPACE}"
- name: Upload APKs
uses: actions/upload-artifact@v2
with:
name: app-debug
path: apks