2019-12-15 21:49:18 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2020-06-24 18:51:05 +00:00
|
|
|
- develop
|
2019-12-15 21:49:18 +00:00
|
|
|
|
|
|
|
name: Deploy snapshot builds
|
|
|
|
jobs:
|
|
|
|
deploy-release-snapshot:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2020-07-14 18:38:34 +00:00
|
|
|
uses: actions/checkout@v2
|
2019-12-15 21:49:18 +00:00
|
|
|
|
|
|
|
- name: Decrypt secrets
|
|
|
|
run: release/signing-setup.sh "$ENCRYPT_KEY"
|
|
|
|
env:
|
|
|
|
ENCRYPT_KEY: ${{ secrets.ENCRYPT_KEY }}
|
|
|
|
|
2020-05-23 11:04:10 +00:00
|
|
|
- name: Generate cache key
|
|
|
|
run: ./.github/checksum.sh checksum.txt
|
|
|
|
|
|
|
|
- name: Cache gradle modules
|
2020-07-14 18:38:34 +00:00
|
|
|
uses: actions/cache@v2
|
2020-05-23 11:04:10 +00:00
|
|
|
with:
|
|
|
|
path: ~/.gradle/caches/modules-2
|
|
|
|
key: ${{ runner.os }}-gradlemodules-${{ hashFiles('checksum.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gradlemodules-
|
|
|
|
|
|
|
|
- name: Cache gradle jars
|
2020-07-14 18:38:34 +00:00
|
|
|
uses: actions/cache@v2
|
2020-05-23 11:04:10 +00:00
|
|
|
with:
|
|
|
|
path: ~/.gradle/caches/jars-3
|
|
|
|
key: ${{ runner.os }}-gradlejars-${{ hashFiles('checksum.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gradlejars-
|
|
|
|
|
|
|
|
- name: Cache gradle build
|
2020-07-14 18:38:34 +00:00
|
|
|
uses: actions/cache@v2
|
2019-12-31 15:27:38 +00:00
|
|
|
with:
|
2020-05-23 11:04:10 +00:00
|
|
|
path: ~/.gradle/caches/build-cache-1
|
|
|
|
key: ${{ runner.os }}-gradlebuildcache-${{ hashFiles('checksum.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gradlebuildcache-
|
2019-12-31 15:27:38 +00:00
|
|
|
|
2019-12-15 21:49:18 +00:00
|
|
|
- name: Download gradle dependencies
|
|
|
|
run: ./gradlew dependencies
|
|
|
|
|
|
|
|
- name: Build release app
|
2020-07-02 18:23:31 +00:00
|
|
|
run: ./gradlew :app:assembleFreeRelease :app:assembleNonFreeRelease
|
2019-12-15 21:49:18 +00:00
|
|
|
env:
|
|
|
|
SNAPSHOT: "true"
|
|
|
|
|
|
|
|
- name: Clean secrets
|
|
|
|
run: release/signing-cleanup.sh
|
|
|
|
|
|
|
|
- name: Deploy snapshot
|
|
|
|
run: release/deploy-snapshot.sh
|
|
|
|
env:
|
|
|
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
|
|
|
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
|
|
|
|
SERVER_ADDRESS: ${{ secrets.SERVER_ADDRESS }}
|
|
|
|
SERVER_DESTINATION: ${{ secrets.SERVER_DESTINATION }}
|
|
|
|
SSH_PORT: ${{ secrets.SSH_PORT }}
|
2020-06-12 16:56:40 +00:00
|
|
|
|
|
|
|
- name: Install NodeJS
|
|
|
|
uses: actions/setup-node@v2-beta
|
|
|
|
with:
|
|
|
|
node-version: '12'
|
|
|
|
|
|
|
|
- name: Install cfcli
|
|
|
|
run: npm install -g cloudflare-cli
|
|
|
|
|
|
|
|
- name: Purge Cloudflare cache
|
2020-07-02 18:23:31 +00:00
|
|
|
run: |
|
|
|
|
cfcli --token ${CF_TOKEN} purge "https://dl.msfjarvis.dev/APS/$(cd ./app/build/outputs/apk/nonFree/release/; ls *.apk)"
|
|
|
|
cfcli --token ${CF_TOKEN} purge "https://dl.msfjarvis.dev/APS/$(cd ./app/build/outputs/apk/free/release/; ls *.apk)"
|
2020-06-12 16:56:40 +00:00
|
|
|
env:
|
|
|
|
CF_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|