mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-12-04 13:20:39 +00:00
Compare commits
6 commits
a3f8b49549
...
5d4a990e01
Author | SHA1 | Date | |
---|---|---|---|
|
5d4a990e01 | ||
|
32798bd982 | ||
|
9b27381383 | ||
|
cc3f98c662 | ||
|
191959b12b | ||
|
b9c4796a7a |
4 changed files with 102 additions and 49 deletions
8
.github/workflows/build_apk.yml
vendored
8
.github/workflows/build_apk.yml
vendored
|
@ -64,6 +64,8 @@ env:
|
||||||
BUILD_ARGS: --release --flavor ${{ inputs.flavor }} -t lib/main_${{ inputs.flavor }}.dart
|
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_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
|
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:
|
jobs:
|
||||||
build-android:
|
build-android:
|
||||||
|
@ -109,6 +111,12 @@ jobs:
|
||||||
- name: Increment build number & replace version number
|
- name: Increment build number & replace version number
|
||||||
run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }}
|
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
|
- name: Install Flutter
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
|
|
8
.github/workflows/build_ipa.yml
vendored
8
.github/workflows/build_ipa.yml
vendored
|
@ -39,6 +39,8 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
FLAVOR: "prod"
|
FLAVOR: "prod"
|
||||||
|
RELEASE_NOTES_ARTIFACT_NAME: release_notes_en_${{ inputs.version }}
|
||||||
|
RELEASE_NOTES_PATH: "assets/release_notes"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -104,6 +106,12 @@ jobs:
|
||||||
- name: Increment build number & replace version number
|
- name: Increment build number & replace version number
|
||||||
run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }}
|
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
|
- name: Install Flutter
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
|
|
133
.github/workflows/create_release.yml
vendored
133
.github/workflows/create_release.yml
vendored
|
@ -18,12 +18,21 @@ on:
|
||||||
description: "Version"
|
description: "Version"
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
release-notes:
|
||||||
|
description: "Release notes"
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
run-integration-tests:
|
run-integration-tests:
|
||||||
description: "Run integration tests"
|
description: "Run integration tests"
|
||||||
required: true
|
required: true
|
||||||
type: boolean
|
type: boolean
|
||||||
default: true
|
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"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-integration-tests:
|
run-integration-tests:
|
||||||
name: Run integration tests
|
name: Run integration tests
|
||||||
|
@ -31,9 +40,25 @@ jobs:
|
||||||
uses: ./.github/workflows/run_integration_tests.yml
|
uses: ./.github/workflows/run_integration_tests.yml
|
||||||
secrets: inherit
|
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:
|
build-android:
|
||||||
name: Build Android
|
name: Build Android
|
||||||
needs: [run-integration-tests]
|
needs: [generate-release-notes]
|
||||||
if: ${{ always() && !failure() && !cancelled() }}
|
if: ${{ always() && !failure() && !cancelled() }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -48,7 +73,7 @@ jobs:
|
||||||
|
|
||||||
build-ios:
|
build-ios:
|
||||||
name: Build iOS
|
name: Build iOS
|
||||||
needs: [run-integration-tests]
|
needs: [generate-release-notes]
|
||||||
if: ${{ always() && !failure() && !cancelled() }}
|
if: ${{ always() && !failure() && !cancelled() }}
|
||||||
uses: ./.github/workflows/build_ipa.yml
|
uses: ./.github/workflows/build_ipa.yml
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
@ -59,6 +84,7 @@ jobs:
|
||||||
create-github-release:
|
create-github-release:
|
||||||
name: Create Github release
|
name: Create Github release
|
||||||
needs: [build-android, build-ios]
|
needs: [build-android, build-ios]
|
||||||
|
if: ${{ always() && !failure() && !cancelled() }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
@ -70,38 +96,45 @@ jobs:
|
||||||
- name: Increment build number & replace version number
|
- name: Increment build number & replace version number
|
||||||
run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }}
|
run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }}
|
||||||
|
|
||||||
- name: Commit changes
|
- name: Download release notes
|
||||||
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: Push to main
|
|
||||||
uses: CasperWA/push-protected@v2
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.PUSH_TO_MAIN_TOKEN }}
|
|
||||||
branch: ${{ github.ref_name }}
|
|
||||||
unprotect_reviews: true
|
|
||||||
|
|
||||||
- name: Download apk
|
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: m3_lightmeter_apk
|
name: ${{ env.RELEASE_NOTES_ARTIFACT_NAME }}
|
||||||
|
path: ${{ env.RELEASE_NOTES_PATH }}
|
||||||
|
|
||||||
- name: Rename apk
|
# - name: Commit changes
|
||||||
run: mv app-prod-release.apk m3_lightmeter.apk
|
# 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 }}"
|
||||||
|
|
||||||
- uses: ncipollo/release-action@v1.12.0
|
# - name: Push to main
|
||||||
with:
|
# uses: CasperWA/push-protected@v2
|
||||||
artifacts: "m3_lightmeter.apk"
|
# with:
|
||||||
skipIfReleaseExists: true
|
# token: ${{ secrets.PUSH_TO_MAIN_TOKEN }}
|
||||||
tag: "v${{ github.event.inputs.version }}"
|
# branch: ${{ github.ref_name }}
|
||||||
bodyFile: "assets/release_notes/release_notes_en_${{ inputs.version }}.md"
|
# unprotect_reviews: true
|
||||||
|
|
||||||
|
# - name: Download apk
|
||||||
|
# uses: actions/download-artifact@v3
|
||||||
|
# with:
|
||||||
|
# name: m3_lightmeter_apk
|
||||||
|
|
||||||
|
# - 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_PATH }}/${{ env.RELEASE_NOTES_FILE }}"
|
||||||
|
|
||||||
create-google-play-release:
|
create-google-play-release:
|
||||||
name: Create Google Play release
|
name: Create Google Play release
|
||||||
needs: [build-android, build-ios]
|
needs: [build-android, build-ios]
|
||||||
|
if: ${{ always() && !failure() && !cancelled() }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
@ -118,36 +151,42 @@ jobs:
|
||||||
unzip app-prod-release.aab
|
unzip app-prod-release.aab
|
||||||
(cd base/lib && zip -r "$OLDPWD/merged_native_libs.zip" .)
|
(cd base/lib && zip -r "$OLDPWD/merged_native_libs.zip" .)
|
||||||
|
|
||||||
|
- name: Download release notes
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ env.RELEASE_NOTES_ARTIFACT_NAME }}
|
||||||
|
|
||||||
- name: Move release notes to a folder
|
- name: Move release notes to a folder
|
||||||
run: |
|
run: |
|
||||||
mv assets/release_notes/release_notes_en_${{ inputs.version }}.md whatsnew-en-US
|
mv ${{ env.RELEASE_NOTES_FILE }} whatsnew-en-US
|
||||||
mkdir whatsnew
|
mkdir whatsnew
|
||||||
mv whatsnew-en-US whatsnew
|
mv whatsnew-en-US whatsnew
|
||||||
|
|
||||||
# https://unix.stackexchange.com/questions/13466/can-grep-output-only-specified-groupings-that-match'
|
# 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
|
# https://stackoverflow.com/questions/74353311/github-workflow-unable-to-process-file-command-env-successfully
|
||||||
- name: Create Google Play release name
|
# - name: Create Google Play release name
|
||||||
id: release-name
|
# id: release-name
|
||||||
run: |
|
# run: |
|
||||||
RELEASE_NAME=$(echo "$(cat pubspec.yaml)" | sed -n -r "s/^version:\s{1}(.*)[+](.*)$/700\2 (\1)/p")
|
# RELEASE_NAME=$(echo "$(cat pubspec.yaml)" | sed -n -r "s/^version:\s{1}(.*)[+](.*)$/700\2 (\1)/p")
|
||||||
echo "release_name=$RELEASE_NAME" >> $GITHUB_ENV
|
# echo "release_name=$RELEASE_NAME" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Create Google Play release
|
# - name: Create Google Play release
|
||||||
id: create-google-play-release-step
|
# id: create-google-play-release-step
|
||||||
uses: r0adkll/upload-google-play@v1.1.1
|
# uses: r0adkll/upload-google-play@v1.1.1
|
||||||
with:
|
# with:
|
||||||
serviceAccountJsonPlainText: ${{ secrets.GH_ACTIONS_SERVICE_ACCOUNT_JSON }}
|
# serviceAccountJsonPlainText: ${{ secrets.GH_ACTIONS_SERVICE_ACCOUNT_JSON }}
|
||||||
packageName: com.vodemn.lightmeter
|
# packageName: com.vodemn.lightmeter
|
||||||
releaseFiles: app-prod-release.aab
|
# releaseFiles: app-prod-release.aab
|
||||||
releaseName: ${{ env.release_name }}
|
# releaseName: ${{ env.release_name }}
|
||||||
track: production
|
# track: production
|
||||||
status: completed
|
# status: completed
|
||||||
debugSymbols: merged_native_libs.zip
|
# debugSymbols: merged_native_libs.zip
|
||||||
whatsNewDirectory: whatsnew
|
# whatsNewDirectory: whatsnew
|
||||||
|
|
||||||
upload-to-app-store:
|
upload-to-app-store:
|
||||||
name: Upload to App Store
|
name: Upload to App Store
|
||||||
needs: [build-android, build-ios]
|
needs: [build-android, build-ios]
|
||||||
|
if: ${{ always() && !failure() && !cancelled() }}
|
||||||
runs-on: macos-13
|
runs-on: macos-13
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
@ -159,8 +198,8 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: m3_lightmeter_ipa
|
name: m3_lightmeter_ipa
|
||||||
|
|
||||||
- name: Upload app to TestFlight
|
# - 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 }}
|
# run: xcrun altool --upload-app -f lightmeter.ipa -t ios -u ${{ secrets.APP_STORE_USERNAME }} -p ${{ secrets.APP_STORE_PASSWORD }}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
name: Cleanup
|
name: Cleanup
|
||||||
|
@ -174,7 +213,5 @@ jobs:
|
||||||
with:
|
with:
|
||||||
failOnError: false
|
failOnError: false
|
||||||
name: |
|
name: |
|
||||||
m3_lightmeter_apk
|
|
||||||
m3_lightmeter_appbundle
|
m3_lightmeter_appbundle
|
||||||
m3_lightmeter_ipa
|
m3_lightmeter_ipa
|
||||||
whatsnew-en-US
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ dependencies:
|
||||||
m3_lightmeter_resources:
|
m3_lightmeter_resources:
|
||||||
git:
|
git:
|
||||||
url: "https://github.com/vodemn/m3_lightmeter_resources"
|
url: "https://github.com/vodemn/m3_lightmeter_resources"
|
||||||
ref: v1.2.0
|
ref: v1.4.0
|
||||||
shared_preferences: 2.2.0
|
shared_preferences: 2.2.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|
Loading…
Reference in a new issue