Merge pull request #58 from BlindOver/dependabot/gradle/android/kotli… #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto Increment Version Code | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Branch | |
uses: actions/checkout@v3 | |
- name: Get current version code | |
id: get_version_code | |
run: | | |
echo "::set-output name=version_code::$(grep 'version_code:' pubspec.yaml | awk '{print $2}')" | |
- name: Increment version code | |
id: increment_version_code | |
run: | | |
echo "::set-output name=version_code::$((${{ steps.get_version_code.outputs.version_code }} + 1))" | |
- name: Update pubspec.yaml | |
run: | | |
sed -i "s/version_code: ${{ steps.get_version_code.outputs.version_code }}/version_code: ${{ steps.increment_version_code.outputs.version_code }}/g" pubspec.yaml |