forked from ankidroid/Anki-Android
-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (70 loc) · 2.68 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
70
71
72
73
74
75
76
77
78
79
80
name: Publish
on:
workflow_dispatch:
inputs:
public:
description: "any non-empty value triggers a public build - version not auto-incremented / changelog required"
required: false
type: string
jobs:
release_app:
name: 'Release App'
timeout-minutes: 120
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
name: Gradle Cache
with:
path: ~/.gradle/caches
key: gradle-${{ hashFiles('**/*.gradle*') }}-v1
- name: Configure JDK
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "21"
- 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 'github@mikehardy.net'
git remote set-url origin git@github.com:$GITHUB_REPOSITORY
shell: bash
- uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Credential Prep
run: |
echo "KEYSTOREPATH=$HOME/src/android-keystore" >> $GITHUB_ENV
echo "KEYALIAS=nrkeystorealias" >> $GITHUB_ENV
echo "KEYSTOREPWD=${{ secrets.KEYSTORE_PASSWORD }}" >> $GITHUB_ENV
echo "KEYPWD=${{ secrets.KEYSTORE_KEY_PASSWORD }}" >> $GITHUB_ENV
mkdir ~/src
cd ~/src
echo "${{ secrets.AMAZON_PUBLISH_CREDENTIALS }}" | base64 -d > ./AnkiDroid-Amazon-Publish-Security-Profile.json.gz
echo "${{ secrets.GOOGLE_PUBLISH_CREDENTIALS }}" | base64 -d > ./AnkiDroid-GCP-Publish-Credentials.json.gz
echo "${{ secrets.RELEASES_PUBLISH_TOKEN }}" | base64 -d > ./my-github-personal-access-token.gz
echo "${{ secrets.KEYSTORE }}" | base64 -d > ./android-keystore.gz
gunzip *.gz
shell: bash
- name: Build and Release public release
if: "${{ github.event.inputs.public != '' }}"
run: |
pushd ../
git clone git@github.com:ankidroid/ankidroiddocs
popd
./tools/release.sh public
shell: bash
- name: Build and Release test release
if: "${{ github.event.inputs.public == '' }}"
run: ./tools/release.sh