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 e5f29e8 commit de49b6f
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
with:
flutter-version: '3.22.2'

- name: Update Build Number
run: ./scripts/update_build_number.sh

- name: Decode Keystore File
env:
KEYSTORE: ${{ secrets.KEYSTORE }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.2'

- name: Update Build Number
run: ./scripts/update_build_number.sh

- name: Install dependencies
run: |
Expand Down Expand Up @@ -61,7 +64,7 @@ jobs:
sudo mv appimagetool-x86_64.AppImage /usr/local/bin/appimagetool
- name: Create AppImage
run: ./.github/scripts/create_appimage.sh
run: ./scripts/create_appimage.sh

- name: Upload AppImage
uses: actions/upload-artifact@v4
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
with:
flutter-version: '3.22.2'

- name: Update Build Number
run: ./scripts/update_build_number.sh

- name: Install Apple Certificate
uses: apple-actions/import-codesign-certs@v1
with:
Expand Down Expand Up @@ -63,7 +66,7 @@ jobs:
xcrun stapler staple "build/macos/Build/Products/Release/maid.app"
- name: Create DMG
run: ./.github/scripts/create_dmg.sh
run: ./scripts/create_dmg.sh

- name: Upload macOS Build
uses: actions/upload-artifact@v4
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.2'

- name: Update Build Number
run: ./scripts/update_build_number.bat

- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.2.9+1697
version: 1.2.9+1707

environment:
sdk: '>=3.0.0 <4.0.0'
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion setup_flutter.bat → scripts/setup_flutter.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
set "script_dir=%~dp0"

:: Remove trailing backslash
set "flutter_path=%script_dir:~0,-1%\packages\flutter\bin"
set "flutter_path=%script_dir:~0,-1%\..\packages\flutter\bin"

:: Add Flutter to the PATH
set PATH=%flutter_path%;%PATH%
Expand Down
2 changes: 1 addition & 1 deletion setup_flutter.sh → scripts/setup_flutter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Add Flutter to the PATH
export PATH="$DIR/packages/flutter/bin:$PATH"

echo "Flutter path set to $DIR/packages/flutter/bin"
echo "Flutter path set to $DIR/../packages/flutter/bin"
6 changes: 6 additions & 0 deletions scripts/update_build_number.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@echo off
:: Get the number of commits
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"
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 de49b6f

Please sign in to comment.