v1.8.2 (#264) #27
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, release_play_store ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- 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: Build app (fat APK) | |
run: | | |
dart run build_runner build | |
flutter gen-l10n | |
flutter build apk --release | |
- name: Build app (per ABIs) | |
run: flutter build apk --release --split-per-abi | |
- name: Create a folder to store the APKs to release | |
run: mkdir release | |
- name: Move and rename APKs | |
run: | | |
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/* |