mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-21 23:10:40 +00:00
increment build number by script
This commit is contained in:
parent
dfb5b55bb6
commit
5e16dca13a
3 changed files with 20 additions and 15 deletions
7
.github/scripts/increment_build_number.sh
vendored
Normal file
7
.github/scripts/increment_build_number.sh
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
export newVersion="$1"
|
||||
|
||||
if [[ -n "$newVersion" ]]; then
|
||||
perl -i -pe 's/^(version:\s+)(\d+\.\d+\.\d+)(\+)(\d+)$/$1.$ENV{'newVersion'}.$3.($4+1)/e' pubspec.yaml
|
||||
else
|
||||
echo "argument error"
|
||||
fi
|
13
.github/workflows/build_apk.yml
vendored
13
.github/workflows/build_apk.yml
vendored
|
@ -27,6 +27,10 @@ jobs:
|
|||
runs-on: macos-11
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Connect private iap package
|
||||
uses: webfactory/ssh-agent@v0.8.0
|
||||
if: ${{ inputs.include-iap }}
|
||||
|
@ -35,13 +39,8 @@ jobs:
|
|||
|
||||
- name: Override iap package with stub
|
||||
if: ${{ !inputs.include-iap }}
|
||||
run: |
|
||||
echo "\ndependency_overrides:\n m3_lightmeter_iap:\n path: iap" >> pubspec.yaml
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
run: bash ./.github/scripts/stub_iap.sh
|
||||
|
||||
- uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: "zulu"
|
||||
|
|
15
.github/workflows/create_release.yml
vendored
15
.github/workflows/create_release.yml
vendored
|
@ -46,6 +46,10 @@ jobs:
|
|||
runs-on: macos-11
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Connect private iap package
|
||||
uses: webfactory/ssh-agent@v0.8.0
|
||||
if: ${{ inputs.include-iap }}
|
||||
|
@ -54,12 +58,7 @@ jobs:
|
|||
|
||||
- name: Override iap package with stub
|
||||
if: ${{ !inputs.include-iap }}
|
||||
run: |
|
||||
echo "\ndependency_overrides:\n m3_lightmeter_iap:\n path: iap" >> pubspec.yaml
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
run: bash ./.github/scripts/stub_iap.sh
|
||||
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
|
@ -98,7 +97,7 @@ jobs:
|
|||
# Therefore here we have to increment it as well to build an apk with the same build number.
|
||||
- name: Increment build number & replace version number
|
||||
if: ${{ inputs.github-release }}
|
||||
run: perl -i -pe 's/^(version:\s+)(\d+\.\d+\.\d+)(\+)(\d+)$/$1."${{ github.event.inputs.version }}".$3.($4+1)/e' pubspec.yaml
|
||||
run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }}
|
||||
|
||||
- name: Install Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
|
@ -160,7 +159,7 @@ jobs:
|
|||
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
|
||||
run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }}
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
|
|
Loading…
Reference in a new issue