mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-21 15:00:40 +00:00
ML-61 Update version in pubspec & create Github release from GitHub actions (#84)
* Replaced zipping action thedoctor0/zip-release@0.7.1 -> vimtor/action-zip@v1.1 * typo * recursive: false * typo * typo * debugSymbolLevel 'FULL' * Update build.gradle * Version bump * wip * wip * `create-release` job * removed changelog input * added `needs` * Version bump * typo * returned to macos-11 runner * reverted pubspec version * Version bump * download artifacts * Version bump * extended artifacts path * Version bump * added LS * Version bump * Version bump * rename files * Version bump * removed ls * Version bump * revert version * typo
This commit is contained in:
parent
8ff387c5c5
commit
79d6034894
1 changed files with 62 additions and 1 deletions
63
.github/workflows/cd_prod.yml
vendored
63
.github/workflows/cd_prod.yml
vendored
|
@ -7,15 +7,20 @@ name: Build prod .aab & .apk
|
|||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "Version"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
env:
|
||||
BUILD_ARGS: --release --flavor prod --dart-define cameraPreviewAspectRatio=2/3 -t lib/main_prod.dart
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build .apk & .aab
|
||||
runs-on: macos-11
|
||||
timeout-minutes: 30
|
||||
|
||||
steps:
|
||||
# - uses: shaunco/ssh-agent@git-repo-mapping
|
||||
# with:
|
||||
|
@ -61,6 +66,9 @@ jobs:
|
|||
echo -n "$FIREBASE_OPTIONS" | base64 --decode --output $FIREBASE_OPTIONS_PATH
|
||||
cp $FIREBASE_OPTIONS_PATH ./lib
|
||||
|
||||
- name: Increment build number & replace version number
|
||||
run: perl -i -pe 's/^(version:\s+)(\d+\.\d+\.\d+)(\+)(\d+)$/$1."${{ github.event.inputs.version }}".$3.($4+1)/e' pubspec.yaml
|
||||
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
|
@ -89,3 +97,56 @@ jobs:
|
|||
with:
|
||||
name: m3_lightmeter_bundle
|
||||
path: build/app/outputs/bundle/prodRelease/app-prod-release.aab
|
||||
|
||||
update-version-in-repo:
|
||||
name: Update repo version
|
||||
needs: [build]
|
||||
runs-on: macos-11
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Increment build number & replace version number
|
||||
run: perl -i -pe 's/^(version:\s+)(\d+\.\d+\.\d+)(\+)(\d+)$/$1."${{ github.event.inputs.version }}".$3.($4+1)/e' pubspec.yaml
|
||||
|
||||
- name: Commit and push changes
|
||||
run: |
|
||||
git config --global user.name "vodemn"
|
||||
git config --global user.email "vadim.turko@gmail.com"
|
||||
|
||||
git add -A
|
||||
git commit -m "Version bump"
|
||||
git push
|
||||
|
||||
create-release:
|
||||
name: Create Github release
|
||||
needs: [build, update-version-in-repo]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Download apk
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: m3_lightmeter_apk
|
||||
|
||||
- name: Download app bundle
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: m3_lightmeter_bundle
|
||||
|
||||
- name: Rename artifacts
|
||||
run: |
|
||||
mv app-prod-release.apk m3_lightmeter.apk
|
||||
mv app-prod-release.aab m3_lightmeter.aab
|
||||
|
||||
- uses: ncipollo/release-action@v1.12.0
|
||||
with:
|
||||
artifacts: "m3_lightmeter.apk, m3_lightmeter.aab"
|
||||
skipIfReleaseExists: true
|
||||
tag: "v${{ github.event.inputs.version }}"
|
||||
|
|
Loading…
Reference in a new issue