fix: fastlane languages #65
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: Release | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
get_version: | |
name: Get the app version | |
environment: release | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.echo_version.outputs.version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get version | |
id: get_version | |
uses: mikefarah/yq@master | |
with: | |
cmd: yq -r '.version' 'pubspec.yaml' | cut -d '+' -f 1 | |
- name: Echo version | |
id: echo_version | |
run: echo "version=${{ steps.get_version.outputs.result }}" >> "$GITHUB_OUTPUT" | |
release_play_store: | |
name: Release on the Play Store | |
environment: release | |
needs: [ get_version ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
flutter-version-file: pubspec.yaml | |
- name: Add keystore | |
run: echo "${{ secrets.ANDROID_KEYSTORE }}" | base64 -d > android/localmaterialnotes_keystore.jks | |
- name: Add key properties | |
run: echo "${{ secrets.ANDROID_KEY_PROPERTIES }}" > android/key.properties | |
- name: Add fastlane supply key | |
run: echo "${{ secrets.FASTLANE_SUPPLY_KEY }}" | base64 -d > fastlane/localmaterialnotes_fastlane-supply_key.json | |
- name: Generate files | |
run: | | |
dart run build_runner build | |
flutter gen-l10n | |
- name: Run fastlane | |
run: bundle exec fastlane deploy_production | |
release_github: | |
name: Release on GitHub | |
environment: release | |
needs: [ get_version ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Read Android NDK version | |
run: | | |
VERSION=$(cat .ndk-version) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Setup Android NDK | |
id: setup-ndk | |
uses: nttld/setup-ndk@v1 | |
with: | |
ndk-version: ${{ env.VERSION }} | |
add-to-path: false | |
- name: Setup Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
cache: false | |
rustflags: "" | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
flutter-version-file: pubspec.yaml | |
- name: Get dependencies | |
run: | | |
export PUB_CACHE=$HOME/.pub-cache | |
flutter pub get | |
- name: Setup Isar | |
run: | | |
sudo apt-get install -y tofrodos | |
fromdos .isar/tool/build_android.sh | |
bash scripts/isar/fdroid_build_isar.sh x64 armv7 arm64 | |
env: | |
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
- name: Setup mimir | |
run: bash scripts/mimir/fdroid_build_mimir.sh x64 armv7 arm64 | |
- name: Add keystore | |
run: echo "${{ secrets.ANDROID_KEYSTORE }}" | base64 -d > android/localmaterialnotes_keystore.jks | |
- name: Add key properties | |
run: echo "${{ secrets.ANDROID_KEY_PROPERTIES }}" > android/key.properties | |
- name: Generate code | |
run: | | |
dart run build_runner build | |
flutter gen-l10n | |
- name: Build app (fat APK) | |
run: flutter build apk --release | |
- name: Build app (per ABIs) | |
run: flutter build apk --release --split-per-abi | |
- name: Move and rename APKs | |
run: | | |
mkdir release | |
mv build/app/outputs/flutter-apk/app-release.apk release/localmaterialnotes_v${{ needs.get_version.outputs.version }}.apk | |
mv build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk release/localmaterialnotes_armeabi-v7a_v${{ needs.get_version.outputs.version }}.apk | |
mv build/app/outputs/flutter-apk/app-arm64-v8a-release.apk release/localmaterialnotes_arm64-v8a_v${{ needs.get_version.outputs.version }}.apk | |
mv build/app/outputs/flutter-apk/app-x86_64-release.apk release/localmaterialnotes_x86_64_v${{ needs.get_version.outputs.version }}.apk | |
- name: Extract changelog | |
id: extract_changelog | |
uses: dahlia/submark@main | |
with: | |
input-file: CHANGELOG.md | |
heading-level: 2 | |
heading-title-regex: ^${{ needs.get_version.outputs.version }} | |
omit-heading: true | |
- name: Create release tag | |
uses: actions/github-script@v7.0.1 | |
with: | |
script: | | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: 'refs/tags/v${{ needs.get_version.outputs.version }}', | |
sha: context.sha | |
}) | |
- name: Publish to GitHub releases | |
uses: softprops/action-gh-release@v2 | |
with: | |
make_latest: true | |
name: v${{ needs.get_version.outputs.version }} | |
body: ${{ steps.extract_changelog.outputs.output-text }} | |
tag_name: v${{ needs.get_version.outputs.version }} | |
files: release/* |