Compare commits

..

1 commit

Author SHA1 Message Date
Vadim
a3f8b49549 returned release notes to release workflow 2024-10-07 20:17:10 +02:00
4 changed files with 74 additions and 92 deletions

View file

@ -64,8 +64,6 @@ env:
BUILD_ARGS: --release --flavor ${{ inputs.flavor }} -t lib/main_${{ inputs.flavor }}.dart
BUILD_APK_PATH: build/app/outputs/flutter-apk/app-${{ inputs.flavor }}-release.apk
BUILD_AAB_PATH: build/app/outputs/bundle/${{ inputs.flavor }}Release/app-${{ inputs.flavor }}-release.aab
RELEASE_NOTES_ARTIFACT_NAME: release_notes_en_${{ inputs.version }}
RELEASE_NOTES_PATH: "assets/release_notes"
jobs:
build-android:
@ -111,12 +109,6 @@ jobs:
- name: Increment build number & replace version number
run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }}
- name: Download release notes
uses: actions/download-artifact@v3
with:
name: ${{ env.RELEASE_NOTES_ARTIFACT_NAME }}
path: ${{ env.RELEASE_NOTES_PATH }}
- name: Install Flutter
uses: subosito/flutter-action@v2
with:

View file

@ -39,8 +39,6 @@ on:
env:
FLAVOR: "prod"
RELEASE_NOTES_ARTIFACT_NAME: release_notes_en_${{ inputs.version }}
RELEASE_NOTES_PATH: "assets/release_notes"
jobs:
build:
@ -106,12 +104,6 @@ jobs:
- name: Increment build number & replace version number
run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }}
- name: Download release notes
uses: actions/download-artifact@v3
with:
name: ${{ env.RELEASE_NOTES_ARTIFACT_NAME }}
path: ${{ env.RELEASE_NOTES_PATH }}
- name: Install Flutter
uses: subosito/flutter-action@v2
with:

View file

@ -29,9 +29,7 @@ on:
default: true
env:
RELEASE_NOTES_ARTIFACT_NAME: release_notes_en_${{ inputs.version }}
RELEASE_NOTES_FILE: release_notes_en_${{ inputs.version }}.md
RELEASE_NOTES_PATH: "assets/release_notes"
RELEASE_NOTES_FILE: release_notes_en_${{ inputs.version }}
jobs:
run-integration-tests:
@ -40,25 +38,9 @@ jobs:
uses: ./.github/workflows/run_integration_tests.yml
secrets: inherit
generate-release-notes:
name: Generate release notes
needs: [run-integration-tests]
if: ${{ always() && !failure() && !cancelled() }}
runs-on: ubuntu-latest
steps:
- name: Generate release notes
run: |
echo ${{ inputs.release-notes }} > ${{ env.RELEASE_NOTES_FILE }}
perl -i -pe 's/\s{1}(-{1})/\n$1/g' ${{ env.RELEASE_NOTES_FILE }}
- name: Upload merged_native_libs.zip to artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.RELEASE_NOTES_ARTIFACT_NAME }}
path: ${{ env.RELEASE_NOTES_FILE }}
build-android:
name: Build Android
needs: [generate-release-notes]
needs: [run-integration-tests]
if: ${{ always() && !failure() && !cancelled() }}
strategy:
matrix:
@ -73,7 +55,7 @@ jobs:
build-ios:
name: Build iOS
needs: [generate-release-notes]
needs: [run-integration-tests]
if: ${{ always() && !failure() && !cancelled() }}
uses: ./.github/workflows/build_ipa.yml
secrets: inherit
@ -81,10 +63,24 @@ jobs:
stage-backend: false
version: ${{ inputs.version }}
generate-release-notes:
name: Generate release notes
needs: [build-android, build-ios]
runs-on: ubuntu-latest
steps:
- name: Generate release notes
run: |
echo ${{ inputs.release-notes }} > ${{ env.RELEASE_NOTES_FILE }}.md
perl -i -pe 's/\s{1}(-{1})/\n$1/g' ${{ env.RELEASE_NOTES_FILE }}.md
- name: Upload merged_native_libs.zip to artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.RELEASE_NOTES_FILE }}
path: ${{ env.RELEASE_NOTES_FILE }}.md
create-github-release:
name: Create Github release
needs: [build-android, build-ios]
if: ${{ always() && !failure() && !cancelled() }}
needs: [generate-release-notes]
runs-on: ubuntu-latest
permissions:
contents: write
@ -99,42 +95,43 @@ jobs:
- name: Download release notes
uses: actions/download-artifact@v3
with:
name: ${{ env.RELEASE_NOTES_ARTIFACT_NAME }}
path: ${{ env.RELEASE_NOTES_PATH }}
name: ${{ env.RELEASE_NOTES_FILE }}
# - name: Commit changes
# run: |
# git config --local user.email "github-actions[bot]@users.noreply.github.com"
# git config --local user.name "github-actions[bot]"
# git add -A
# git commit -m "Release v${{ inputs.version }}"
- name: Move release notes to a folder
run: mv assets/release_notes/${{ env.RELEASE_NOTES_FILE }}.md ${{ env.RELEASE_NOTES_FILE }}
# - name: Push to main
# uses: CasperWA/push-protected@v2
# with:
# token: ${{ secrets.PUSH_TO_MAIN_TOKEN }}
# branch: ${{ github.ref_name }}
# unprotect_reviews: true
- name: Commit changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -A
git commit -m "Release v${{ inputs.version }}"
# - name: Download apk
# uses: actions/download-artifact@v3
# with:
# name: m3_lightmeter_apk
- name: Push to main
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.PUSH_TO_MAIN_TOKEN }}
branch: ${{ github.ref_name }}
unprotect_reviews: true
# - name: Rename apk
# run: mv app-prod-release.apk m3_lightmeter.apk
- name: Download apk
uses: actions/download-artifact@v3
with:
name: m3_lightmeter_apk
# - uses: ncipollo/release-action@v1.12.0
# with:
# artifacts: "m3_lightmeter.apk"
# skipIfReleaseExists: true
# tag: "v${{ github.event.inputs.version }}"
# bodyFile: "${{ env.RELEASE_NOTES_PATH }}/${{ env.RELEASE_NOTES_FILE }}"
- name: Rename apk
run: mv app-prod-release.apk m3_lightmeter.apk
- uses: ncipollo/release-action@v1.12.0
with:
artifacts: "m3_lightmeter.apk"
skipIfReleaseExists: true
tag: "v${{ github.event.inputs.version }}"
bodyFile: "${{ env.RELEASE_NOTES_FILE }}.md"
create-google-play-release:
name: Create Google Play release
needs: [build-android, build-ios]
if: ${{ always() && !failure() && !cancelled() }}
needs: [generate-release-notes]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@ -154,39 +151,38 @@ jobs:
- name: Download release notes
uses: actions/download-artifact@v3
with:
name: ${{ env.RELEASE_NOTES_ARTIFACT_NAME }}
name: ${{ env.RELEASE_NOTES_FILE }}
- name: Move release notes to a folder
run: |
mv ${{ env.RELEASE_NOTES_FILE }} whatsnew-en-US
mv assets/release_notes/${{ env.RELEASE_NOTES_FILE }}.md ${{ env.RELEASE_NOTES_FILE }}
mkdir whatsnew
mv whatsnew-en-US whatsnew
mv ${{ env.RELEASE_NOTES_FILE }} whatsnew
# https://unix.stackexchange.com/questions/13466/can-grep-output-only-specified-groupings-that-match'
# https://stackoverflow.com/questions/74353311/github-workflow-unable-to-process-file-command-env-successfully
# - name: Create Google Play release name
# id: release-name
# run: |
# RELEASE_NAME=$(echo "$(cat pubspec.yaml)" | sed -n -r "s/^version:\s{1}(.*)[+](.*)$/700\2 (\1)/p")
# echo "release_name=$RELEASE_NAME" >> $GITHUB_ENV
- name: Create Google Play release name
id: release-name
run: |
RELEASE_NAME=$(echo "$(cat pubspec.yaml)" | sed -n -r "s/^version:\s{1}(.*)[+](.*)$/700\2 (\1)/p")
echo "release_name=$RELEASE_NAME" >> $GITHUB_ENV
# - name: Create Google Play release
# id: create-google-play-release-step
# uses: r0adkll/upload-google-play@v1.1.1
# with:
# serviceAccountJsonPlainText: ${{ secrets.GH_ACTIONS_SERVICE_ACCOUNT_JSON }}
# packageName: com.vodemn.lightmeter
# releaseFiles: app-prod-release.aab
# releaseName: ${{ env.release_name }}
# track: production
# status: completed
# debugSymbols: merged_native_libs.zip
# whatsNewDirectory: whatsnew
- name: Create Google Play release
id: create-google-play-release-step
uses: r0adkll/upload-google-play@v1.1.1
with:
serviceAccountJsonPlainText: ${{ secrets.GH_ACTIONS_SERVICE_ACCOUNT_JSON }}
packageName: com.vodemn.lightmeter
releaseFiles: app-prod-release.aab
releaseName: ${{ env.release_name }}
track: production
status: completed
debugSymbols: merged_native_libs.zip
whatsNewDirectory: whatsnew
upload-to-app-store:
name: Upload to App Store
needs: [build-android, build-ios]
if: ${{ always() && !failure() && !cancelled() }}
needs: [generate-release-notes]
runs-on: macos-13
steps:
- uses: actions/checkout@v3
@ -198,8 +194,8 @@ jobs:
with:
name: m3_lightmeter_ipa
# - name: Upload app to TestFlight
# run: xcrun altool --upload-app -f lightmeter.ipa -t ios -u ${{ secrets.APP_STORE_USERNAME }} -p ${{ secrets.APP_STORE_PASSWORD }}
- name: Upload app to TestFlight
run: xcrun altool --upload-app -f lightmeter.ipa -t ios -u ${{ secrets.APP_STORE_USERNAME }} -p ${{ secrets.APP_STORE_PASSWORD }}
cleanup:
name: Cleanup
@ -213,5 +209,7 @@ jobs:
with:
failOnError: false
name: |
m3_lightmeter_apk
m3_lightmeter_appbundle
m3_lightmeter_ipa
${{ env.RELEASE_NOTES_FILE }}

View file

@ -13,7 +13,7 @@ dependencies:
m3_lightmeter_resources:
git:
url: "https://github.com/vodemn/m3_lightmeter_resources"
ref: v1.4.0
ref: v1.2.0
shared_preferences: 2.2.0
dev_dependencies: