mirror of
https://github.com/Darkrock-Studios/hammer-editor.git
synced 2026-08-15 20:43:14 +00:00
91 lines
2.8 KiB
YAML
91 lines
2.8 KiB
YAML
name: Publish — Google Play
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
track:
|
|
description: "Play Store track to publish to"
|
|
type: choice
|
|
required: true
|
|
default: internal
|
|
options:
|
|
- internal
|
|
- alpha
|
|
- beta
|
|
- production
|
|
workflow_call:
|
|
inputs:
|
|
track:
|
|
type: string
|
|
required: true
|
|
|
|
jobs:
|
|
publish-google-play:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
BUILD_NUMBER: ${{ github.run_number }}
|
|
RELEASE_BUILD: true
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v7
|
|
|
|
- name: set up JDK 21
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
java-version: '21'
|
|
distribution: 'temurin'
|
|
cache: gradle
|
|
|
|
- uses: ruby/setup-ruby@6aaa311d81eba98ae12eaffbcb63296ace0efcde # v1.307.0
|
|
with:
|
|
ruby-version: '3.4.8'
|
|
bundler-cache: true
|
|
|
|
- name: Cache Ruby - Bundler
|
|
uses: actions/cache@v6
|
|
with:
|
|
path: vendor/bundle
|
|
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gems-
|
|
|
|
- name: Grant Permission to Execute
|
|
run: chmod +x gradlew
|
|
|
|
- name: Install bundle
|
|
run: |
|
|
bundle config path vendor/bundle
|
|
bundle install --jobs 4 --retry 3
|
|
|
|
- name: Restore key
|
|
working-directory: /home/runner/work/hammer-editor/hammer-editor/
|
|
run: |
|
|
echo "${{ secrets.RELEASE_KEYSTORE }}" > release.keystore.asc
|
|
echo ${{ secrets.RELEASE_STORE_PASSWORD_BASE64 }} | base64 -d > passphrase
|
|
gpg -d --passphrase-file passphrase --batch release.keystore.asc > release.keystore
|
|
|
|
- name: Create Google Play Config file
|
|
run: |
|
|
echo "$PLAY_CONFIG_JSON" > play_config.json.b64
|
|
base64 -d -i play_config.json.b64 > play_config.json
|
|
env:
|
|
PLAY_CONFIG_JSON: ${{ secrets.PLAY_CONFIG_JSON }}
|
|
|
|
- name: Distribute app to ${{ inputs.track }} track 🚀
|
|
env:
|
|
TRACK: ${{ inputs.track }}
|
|
RELEASE_STORE_FILE: /home/runner/work/hammer-editor/hammer-editor/release.keystore
|
|
RELEASE_STORE_PASSWORD: ${{ secrets.RELEASE_STORE_PASSWORD }}
|
|
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }}
|
|
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
|
|
run: |
|
|
# Map track → fastlane lane. `release` is the lane that ships to production.
|
|
case "$TRACK" in
|
|
internal) LANE=internal ;;
|
|
alpha) LANE=alpha ;;
|
|
beta) LANE=beta ;;
|
|
production) LANE=release ;;
|
|
*) echo "Unknown track: $TRACK" >&2; exit 1 ;;
|
|
esac
|
|
echo "Running fastlane $LANE for track=$TRACK"
|
|
bundle exec fastlane "$LANE"
|