Skip to content

Commit

Permalink
fix(github): add missing build number on cd workflow ds-12
Browse files Browse the repository at this point in the history
  • Loading branch information
KeidsID committed Jan 15, 2025
1 parent 9c24233 commit 11965ad
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
31 changes: 27 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ jobs:
- name: 📦 Get dependencies
run: flutter pub get

web-deploy:
web-github-pages:
name: 🚀 Web Deploy on Github Pages
needs: dependencies
runs-on: macos-latest

Expand All @@ -87,9 +88,20 @@ jobs:
dart run build_runner build -d
flutter gen-l10n
- name: 🏗️ Release build number setup
id: build-number
uses: onyxmueller/build-tag-number@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
prefix: build-number--web--github-action

- name: 🏗️ Build web release
env:
BASE_HREF: "/dicoding_story_fl/"
BUILD_NUMBER: ${{ steps.build-number.outputs.build_number }}
WEB_RENDERER: canvaskit
run: |
flutter build web --release --base-href "/dicoding_story_fl/" --web-renderer canvaskit
flutter build web --release --base-href ${{ env.BASE_HREF }} --build-number ${{ env.BUILD_NUMBER }} --build-number ${{ env.BUILD_NUMBER }} --web-renderer ${{ env.WEB_RENDERER }}
- name: 🚀 Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v3
Expand All @@ -98,7 +110,8 @@ jobs:
publish_dir: ./build/web
publish_branch: web-release

gh-apk-release:
apk-github-release:
name: 🚀 Apk Release on Github Release
needs: dependencies
runs-on: macos-latest

Expand Down Expand Up @@ -126,8 +139,18 @@ jobs:
echo "${{ secrets.ANDROID_RELEASE_KEY_BASE64 }}" | base64 --decode > secrets/android-release-key.jks
echo "${{ secrets.ANDROID_KEY_PROPS_BASE64 }}" | base64 --decode > android/key.properties
- name: 🏗️ Release build number setup
id: build-number
uses: onyxmueller/build-tag-number@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
prefix: build-number--apk--github-release

- name: 🏗️ Build APK release
run: flutter build apk --release
env:
BUILD_NUMBER: ${{ steps.build-number.outputs.build_number }}
run: |
flutter build apk --release --build-number ${{ env.BUILD_NUMBER }}
- name: 📝 Release build
uses: ncipollo/release-action@v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class AppAboutListTile extends StatelessWidget {
image: AssetImages.appIconL,
width: 80.0,
),
applicationVersion:
"v${package.version}${package.buildNumber.isNotEmpty ? "+${package.buildNumber}" : ""}",
applicationVersion: "v${package.version}"
"${package.buildNumber.isNotEmpty ? "+${package.buildNumber}" : ""}",
applicationLegalese: "MIT License\n\n"
"Copyright (c) 2024 Kemal Idris [KeidsID]",
aboutBoxChildren: [
Expand Down

0 comments on commit 11965ad

Please sign in to comment.