forked from ankidroid/Anki-Android
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (59 loc) · 2.42 KB
/
publish.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
name: Publish
on:
workflow_dispatch:
jobs:
release_app:
name: 'Release App'
timeout-minutes: 40
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
name: Gradle Cache
with:
path: ~/.gradle/caches
key: gradle-${{ hashFiles('**/*.gradle*') }}-v1
- name: Configure JDK 1.11
uses: actions/setup-java@v2
with:
distribution: "adopt"
java-version: "11" # ubuntu-latest is about to default to 11, force it everywhere
- name: Verify JDK11
# Default JDK varies depending on different runner flavors, make sure we are on 11
# Run a check that exits with error unless it is 11 version to future-proof against unexpected upgrades
run: java -fullversion 2>&1 | grep '11.0'
shell: bash
- name: Install Release Utilities
run: |
mkdir ~/bin/
curl -L -o ~/bin/github-release.bz2 https://github.com/github-release/github-release/releases/download/v0.10.0/linux-amd64-github-release.bz2
cd ~/bin
bunzip2 github-release.bz2
chmod 755 ~/bin/github-release
sudo chown -R $USER /var/lib/gems/
sudo chown -R $USER /usr/local/bin
gem install asciidoctor
shell: bash
- name: GIT Setup
run: |
git config --global user.name 'Mike Hardy'
git config --global user.email '[email protected]'
git remote set-url origin [email protected]:$GITHUB_REPOSITORY
shell: bash
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Credential Prep
run: |
echo "KSTOREPWD=${{ secrets.KEYSTORE_PASSWORD }}" >> $GITHUB_ENV
echo "KEYPWD=${{ secrets.KEYSTORE_KEY_PASSWORD }}" >> $GITHUB_ENV
mkdir ~/src
echo "${{ secrets.AMAZON_PUBLISH_CREDENTIALS }}" | base64 -d > ~/src/AnkiDroid-Amazon-Publish-Security-Profile.json.gz
echo "${{ secrets.GOOGLE_PUBLISH_CREDENTIALS }}" | base64 -d > ~/src/AnkiDroid-GCP-Publish-Credentials.json.gz
echo "${{ secrets.RELEASES_PUBLISH_TOKEN }}" | base64 -d > ~/src/my-github-personal-access-token.gz
echo "${{ secrets.KEYSTORE }}" | base64 -d > ~/src/android-keystore.gz
cd ~/src
gunzip *gz
shell: bash
- name: Build and Release
run: ./tools/release.sh