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:
Vadim 2023-06-27 12:17:35 +02:00 committed by GitHub
parent 8ff387c5c5
commit 79d6034894
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,15 +7,20 @@ name: Build prod .aab & .apk
on: on:
workflow_dispatch: workflow_dispatch:
inputs:
version:
description: "Version"
required: true
type: string
env: env:
BUILD_ARGS: --release --flavor prod --dart-define cameraPreviewAspectRatio=2/3 -t lib/main_prod.dart BUILD_ARGS: --release --flavor prod --dart-define cameraPreviewAspectRatio=2/3 -t lib/main_prod.dart
jobs: jobs:
build: build:
name: Build .apk & .aab
runs-on: macos-11 runs-on: macos-11
timeout-minutes: 30 timeout-minutes: 30
steps: steps:
# - uses: shaunco/ssh-agent@git-repo-mapping # - uses: shaunco/ssh-agent@git-repo-mapping
# with: # with:
@ -61,6 +66,9 @@ jobs:
echo -n "$FIREBASE_OPTIONS" | base64 --decode --output $FIREBASE_OPTIONS_PATH echo -n "$FIREBASE_OPTIONS" | base64 --decode --output $FIREBASE_OPTIONS_PATH
cp $FIREBASE_OPTIONS_PATH ./lib 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 - name: Install Flutter
uses: subosito/flutter-action@v2 uses: subosito/flutter-action@v2
with: with:
@ -89,3 +97,56 @@ jobs:
with: with:
name: m3_lightmeter_bundle name: m3_lightmeter_bundle
path: build/app/outputs/bundle/prodRelease/app-prod-release.aab 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 }}"