Skip to content

Commit

Permalink
scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Jul 9, 2024
1 parent 28ffd14 commit 850fcf6
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ jobs:
flutter-version: '3.22.2'

- name: Update Build Number
run: ./scripts/update_build_number.sh
run: |
commit_count=$(git rev-list --count HEAD)
sed -i "s/version: \(.*\)+.*/version: \1+$commit_count/" pubspec.yaml
- name: Decode Keystore File
env:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ jobs:
flutter-version: '3.22.2'

- name: Update Build Number
run: ./scripts/update_build_number.sh
run: |
commit_count=$(git rev-list --count HEAD)
sed -i "s/version: \(.*\)+.*/version: \1+$commit_count/" pubspec.yaml
- name: Install dependencies
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ jobs:
flutter-version: '3.22.2'

- name: Update Build Number
run: ./scripts/update_build_number.sh
run: |
commit_count=$(git rev-list --count HEAD)
sed -i "s/version: \(.*\)+.*/version: \1+$commit_count/" pubspec.yaml
- name: Install Apple Certificate
uses: apple-actions/import-codesign-certs@v1
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ jobs:
flutter-version: '3.22.2'

- name: Update Build Number
run: ./scripts/update_build_number.bat
run: |
git fetch --prune --unshallow
commit_count=$(git rev-list --count HEAD)
(Get-Content pubspec.yaml) -replace 'version: (.*)\+.*', 'version: $1+' + $commit_count | Set-Content pubspec.yaml
- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion scripts/update_build_number.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
for /f %%i in ('git rev-list --count HEAD') do set commit_count=%%i

:: Update the pubspec.yaml file with the new build number
powershell -Command "(gc ../pubspec.yaml) -replace 'version: (.*)\+.*', 'version: $1+%commit_count%' | Out-File -encoding ASCII ./pubspec.yaml"
powershell -Command "(gc ../pubspec.yaml) -replace 'version: (.*)\+.*', 'version: $1+%commit_count%' | Out-File -encoding ASCII ../pubspec.yaml"
2 changes: 1 addition & 1 deletion scripts/update_build_number.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
commit_count=$(git rev-list --count HEAD)

# Update the pubspec.yaml file with the new build number
sed -i '' "s/version: \(.*\)+.*/version: \1+$commit_count/" ./pubspec.yaml
sed -i '' "s/version: \(.*\)+.*/version: \1+$commit_count/" ../pubspec.yaml

0 comments on commit 850fcf6

Please sign in to comment.