Files
paperless-mobile/.github/workflows/release_deploy_play_store.yml
2023-04-27 19:32:23 +02:00

123 lines
3.7 KiB
YAML

## See https://github.com/flutter/gallery/blob/main/.github/workflows/release_deploy_play_store.yml
name: Deploy to Play Store and draft new GitHub release
on:
# Enable manual run
workflow_dispatch:
inputs:
lane:
description: "Fastlane lane"
required: true
default: "alpha"
type: choice
options:
- internal
- promote_to_alpha
- alpha
- promote_to_beta
- beta
- promote_to_production
- production
version_tag:
description: "Tag for the release"
required: true
type: string
is_draft:
description: "Only create a draft and don't automatically publish?"
required: true
default: true
type: boolean
# Declare default permissions as read only.
permissions: read-all
jobs:
fastlane-deploy-to-play-store:
name: "Deploy to Google Play Store"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Clone flutter repository
uses: subosito/flutter-action@v2
with:
channel: stable
- run: flutter doctor -v
- name: Setup signing config
uses: ./.github/actions/setup-android-signing-config
with:
keystore-key-alias: ${{ secrets.KEYSTORE_KEY_ALIAS }}
keystore-key-password: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
keystore-store-password: ${{ secrets.KEYSTORE_STORE_PASSWORD }}
release-keystore: ${{ secrets.RELEASE_KEYSTORE }}
release-keystore-passphrase: ${{ secrets.RELEASE_KEYSTORE_PASSPHRASE }}
- name: Get packages and run codegen
run: |
bash install_dependencies.sh
working-directory: scripts
- name: Setup Fastlane
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.6"
bundler-cache: true
working-directory: android
# Build and deploy with Fastlane
# Naturally, promote_to_{alpha|beta|production} only deploys.
- run: bundle exec fastlane ${{ github.event.inputs.lane }}
env:
PLAY_STORE_CREDENTIALS: ${{ secrets.PLAY_STORE_CREDENTIALS }}
working-directory: android
create-github-release:
name: "Create GitHub Release"
runs-on: ubuntu-latest
steps:
# Setup Ruby, Bundler, and Gemfile dependencies
- name: Extract branch name
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_OUTPUT
id: extract_branch
- name: Checkout repository
uses: actions/checkout@v3
- name: Clone flutter repository
uses: subosito/flutter-action@v2
with:
channel: stable
- run: flutter doctor -v
- name: Setup signing config
uses: ./.github/actions/setup-android-signing-config
with:
keystore-key-alias: ${{ secrets.KEYSTORE_KEY_ALIAS }}
keystore-key-password: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
keystore-store-password: ${{ secrets.KEYSTORE_STORE_PASSWORD }}
release-keystore: ${{ secrets.RELEASE_KEYSTORE }}
release-keystore-passphrase: ${{ secrets.RELEASE_KEYSTORE_PASSPHRASE }}
- name: Get packages and run codegen
run: |
bash install_dependencies.sh
working-directory: scripts
- name: Setup Fastlane
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.6"
bundler-cache: true
working-directory: android
- run: bundle exec fastlane github branch:${{ steps.extract_branch.outputs.branch }} is_draft:${{ github.event.inputs.is_draft }}
env:
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
working-directory: android