Skip to content

Commit

Permalink
chore(ci): rework the CI integration
Browse files Browse the repository at this point in the history
 - no more dev branch
 - new pre-release stage added
 - `beta` versions now clearly visible
  • Loading branch information
vareversat committed Apr 21, 2024
1 parent ace6cd6 commit 427b741
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 19 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/action.release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Action - Release

on:
workflow_call:
inputs:
is_a_prerelease:
description: 'Specify if this need to be tagged as a pre-release version'
required: true
type: boolean

jobs:
changelog:
Expand Down Expand Up @@ -43,6 +48,7 @@ jobs:
- name: 'Generate Github release'
uses: softprops/action-gh-release@v2
with:
prerelease: ${{ inputs.is_a_prerelease }}
name: '${{ github.ref_name }} 🚀'
body_path: CHANGELOG.md
files: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/push.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches-ignore:
- main
- dev

concurrency:
group: ci-${{ github.ref }}
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/push.main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ jobs:
with:
flutter_version: '3.19.3'
secrets: inherit
page:
uses: ./.github/workflows/action.pages.deploy.yaml
flutter-build:
needs: [ flutter-test-analyze ]
uses: ./.github/workflows/action.flutter.build.yaml
with:
flutter_version: '3.19.3'
android_output: 'aab'
env: 'prd'
env: 'dev'
secrets: inherit
fastlane:
fastlane-dry-run:
needs: [ flutter-build ]
uses: ./.github/workflows/action.fastlane.yaml
with:
lane: 'prd'
lane: 'dry_run'
secrets: inherit
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Tag workflow
on:
push:
tags:
- v*
- 'v[0-9]+.[0-9]+.[0-9]+-beta$'

concurrency:
group: ci-${{ github.ref }}
Expand All @@ -26,6 +26,8 @@ jobs:
release:
needs: [ flutter-build ]
uses: ./.github/workflows/action.release.yaml
with:
is_a_prerelease: true
fastlane:
needs: [ flutter-build ]
uses: ./.github/workflows/action.fastlane.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
name: Dev workflow
name: Main workflow

on:
push:
branches:
- dev

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
tags:
- 'v[0-9]+.[0-9]+.[0-9]+$'

jobs:
flutter-test-analyze:
uses: ./.github/workflows/action.flutter.analyze-test.yaml
with:
flutter_version: '3.19.3'
secrets: inherit
page:
uses: ./.github/workflows/action.pages.deploy.yaml
flutter-build:
needs: [ flutter-test-analyze ]
uses: ./.github/workflows/action.flutter.build.yaml
with:
flutter_version: '3.19.3'
android_output: 'aab'
env: 'dev'
env: 'prd'
secrets: inherit
fastlane-dry-run:
release:
needs: [ flutter-build ]
uses: ./.github/workflows/action.release.yaml
with:
is_a_prerelease: false
fastlane:
needs: [ flutter-build ]
uses: ./.github/workflows/action.fastlane.yaml
with:
lane: 'dry_run'
lane: 'prd'
secrets: inherit
10 changes: 9 additions & 1 deletion lib/screens/chabo_about_screen/chabo_about_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ class ChaboAboutScreen extends StatelessWidget {

ChaboAboutScreen({super.key});

String _formatBetaVersion(String versionCode) {
if (versionCode.contains('beta')) {
return "${versionCode.split('-')[0]}-β";
} else {
return versionCode;
}
}

@override
Widget build(BuildContext context) {
final textTheme = Theme.of(context).textTheme;
Expand Down Expand Up @@ -143,7 +151,7 @@ class ChaboAboutScreen extends StatelessWidget {
),
),
Text(
' | v${snapshot.data!.version} (${snapshot.data!.buildNumber})',
' | v${_formatBetaVersion(snapshot.data!.version)} (${snapshot.data!.buildNumber})',
style: textTheme.bodyMedium,
),
],
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Mobile app to get the closing and opening schedules of the Chaban D

publish_to: 'none'

version: 2.5.3
version: 2.5.3-beta

environment:
sdk: '>=3.0.0 <4.0.0'
Expand Down

0 comments on commit 427b741

Please sign in to comment.