increment build number by script

This commit is contained in:
Vadim 2023-09-02 12:18:01 +02:00
parent dfb5b55bb6
commit 5e16dca13a
3 changed files with 20 additions and 15 deletions

View 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

View file

@ -27,6 +27,10 @@ jobs:
runs-on: macos-11 runs-on: macos-11
timeout-minutes: 15 timeout-minutes: 15
steps: steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Connect private iap package - name: Connect private iap package
uses: webfactory/ssh-agent@v0.8.0 uses: webfactory/ssh-agent@v0.8.0
if: ${{ inputs.include-iap }} if: ${{ inputs.include-iap }}
@ -35,13 +39,8 @@ jobs:
- name: Override iap package with stub - name: Override iap package with stub
if: ${{ !inputs.include-iap }} if: ${{ !inputs.include-iap }}
run: | run: bash ./.github/scripts/stub_iap.sh
echo "\ndependency_overrides:\n m3_lightmeter_iap:\n path: iap" >> pubspec.yaml
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-java@v2 - uses: actions/setup-java@v2
with: with:
distribution: "zulu" distribution: "zulu"

View file

@ -46,6 +46,10 @@ jobs:
runs-on: macos-11 runs-on: macos-11
timeout-minutes: 30 timeout-minutes: 30
steps: steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Connect private iap package - name: Connect private iap package
uses: webfactory/ssh-agent@v0.8.0 uses: webfactory/ssh-agent@v0.8.0
if: ${{ inputs.include-iap }} if: ${{ inputs.include-iap }}
@ -54,12 +58,7 @@ jobs:
- name: Override iap package with stub - name: Override iap package with stub
if: ${{ !inputs.include-iap }} if: ${{ !inputs.include-iap }}
run: | run: bash ./.github/scripts/stub_iap.sh
echo "\ndependency_overrides:\n m3_lightmeter_iap:\n path: iap" >> pubspec.yaml
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-java@v3 - uses: actions/setup-java@v3
with: with:
@ -98,7 +97,7 @@ jobs:
# Therefore here we have to increment it as well to build an apk with the same build number. # 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 - name: Increment build number & replace version number
if: ${{ inputs.github-release }} 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 - name: Install Flutter
uses: subosito/flutter-action@v2 uses: subosito/flutter-action@v2
@ -160,7 +159,7 @@ jobs:
submodules: recursive submodules: recursive
- name: Increment build number & replace version number - 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 - name: Commit changes
run: | run: |