-
Notifications
You must be signed in to change notification settings - Fork 26
81 lines (69 loc) · 2.68 KB
/
generate_daily_snapshot.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: Generate daily snapshot
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '00 0 * * *'
workflow_dispatch:
jobs:
cancel_previous:
name: Cancel previous runs
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
generate_daily_snapshot:
name: Generate daily snapshot from develop
runs-on: ubuntu-latest
needs: cancel_previous
steps:
- name: Checkout develop
uses: actions/checkout@v3
with:
ref: develop
fetch-depth: 0 # Whole repo history
- name: Check if there has been new commits in the last 24 hours
id: check-new-commits
uses: adriangl/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: develop
seconds: 86400 # one day
- name: Cancel job if no new commits have been found in the last 24 hours
if: ${{ steps.check-new-commits.outputs.has-new-commits != 'true' }}
uses: andymckay/[email protected]
- name: Fetch all tags
run: git fetch origin +refs/tags/*:refs/tags/*
- name: Install fastlane-plugin-android_build_tools deploy key
uses: shimataro/[email protected]
with:
key: ${{ secrets.ANDROID_BUILD_TOOLS_DEPLOY_KEY }}
name: id_rsa
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: Set-up and configure JDK 11
uses: actions/[email protected]
with:
distribution: zulu
java-version: 11
cache: gradle
- name: Set-up and configure Ruby
uses: ruby/[email protected]
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Install keysafe deploy key
uses: shimataro/[email protected]
with:
key: ${{ secrets.KEYSAFE_DEPLOY_KEY }}
name: id_rsa
known_hosts: ${{ secrets.KNOWN_HOSTS }}
if_key_exists: replace
- name: Generate daily snapshot and publish it
env:
KEYSAFE_REPO_URL: ${{ secrets.KEYSAFE_REPO_URL }}
APP_KEYSAFE_NAME: ${{ secrets.APP_KEYSAFE_NAME }}
APP_KEYSAFE_PASSWORD: ${{ secrets.APP_KEYSAFE_PASSWORD }}
GITHUB_REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
bundle exec fastlane generate_daily_snapshot app_keysafe_name:"$APP_KEYSAFE_NAME" app_keysafe_password:"$APP_KEYSAFE_PASSWORD" artifact_type:AAB github_repository_name:"$GITHUB_REPO" github_api_token:"$GITHUB_TOKEN"