Publish #40
Workflow file for this run
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: | |
release: | |
types: [ published ] | |
jobs: | |
publish-google-play: | |
runs-on: ubuntu-latest | |
env: | |
BUILD_NUMBER: ${{ github.run_number }} | |
RELEASE_BUILD: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: gradle | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.2.2' | |
bundler-cache: true | |
- name: Cache Ruby - Bundler | |
uses: actions/cache@v4 | |
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: Publish F-Droid | |
run: | | |
./gradlew publishFdroid | |
- name: Distribute app to Production track 🚀 | |
run: bundle exec fastlane release | |
env: | |
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 }} | |
notify: | |
needs: publish-google-play | |
runs-on: ubuntu-latest | |
steps: | |
- name: Discord notification | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
uses: Ilshidur/action-discord@master | |
with: | |
args: '**New release:** {{ EVENT_PAYLOAD.release.name }} **Download Here:** {{ EVENT_PAYLOAD.release.html_url }}' |