🚀 Publish #257
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "17" # newer libraries require 17, also change jitpack.yml | |
- name: Verify JDK17 | |
# Default JDK varies depending on different runner flavors, make sure we are on 17 | |
# Run a check that exits with error unless it is 17 version to future-proof against unexpected upgrades | |
run: java -fullversion 2>&1 | grep '17.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 public release | |
if: "${{ github.event.inputs.public != '' }}" | |
run: | | |
pushd ../ | |
git clone [email protected]:ankidroid/ankidroiddocs | |
popd | |
./tools/release.sh public | |
shell: bash | |
- name: Build and Release test release | |
if: "${{ github.event.inputs.public == '' }}" | |
run: ./tools/release.sh |