Skip to content

Commit

Permalink
chore: Fixing workflow usage
Browse files Browse the repository at this point in the history
  • Loading branch information
niyajali committed Nov 28, 2024
1 parent 39fb274 commit 912696a
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 15 deletions.
65 changes: 53 additions & 12 deletions .github/workflows/build_and_publish_on_platforms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,21 @@ on:
description: Distribute Desktop Apps On App Store
distribute_web:
type: boolean
default: false
default: true
description: Distribute Web App

permissions:
contents: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build_android:
name: Build Android Application
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -80,6 +87,7 @@ jobs:
path: ./**/*.apk

distribute_android_on_firebase:
name: Deploy Android App On Firebase
needs: [ build_android, generate_release_info ]
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -128,6 +136,7 @@ jobs:
run: ./gradlew appDistributionUploadProdRelease --no-configuration-cache

distribute_android_on_playstore:
name: Distribute Android App On Play Store
needs: [ build_android, generate_release_info ]
if: inputs.distribute_android
runs-on: macos-latest
Expand Down Expand Up @@ -188,6 +197,7 @@ jobs:
run: bundle exec fastlane promote_to_beta

build_ios:
name: Build iOS App
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -221,7 +231,7 @@ jobs:
path: mifospay-ios/mifospay-ios-app.ipa

distribute_ios_app_to_firebase:
name: Build iOS App
name: Distribute iOS App On Firebase
needs: [ build_ios ]
runs-on: macos-latest
permissions:
Expand Down Expand Up @@ -254,6 +264,7 @@ jobs:

distribute_ios_app_to_app_center:
needs: [ build_ios ]
name: Distribute iOS App On App Center
if: inputs.distribute_ios || inputs.release_type == 'internal'
runs-on: macos-latest
steps:
Expand All @@ -272,6 +283,7 @@ jobs:
# Distribute on App Store

build_desktop:
name: Build Desktop App
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
Expand All @@ -283,6 +295,9 @@ jobs:
java-version: 17
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build Desktop App
env:
NOTARIZATION_APPLE_ID: ${{ secrets.NOTARIZATION_APPLE_ID }}
Expand Down Expand Up @@ -320,6 +335,7 @@ jobs:
path: './mifospay-desktop/build/compose/binaries/main-release/dmg/*.dmg'

distribute_desktop:
name: Distribute Desktop App
needs: [ build_desktop ]
if: inputs.distribute_desktop || inputs.release_type == 'beta'
runs-on: ubuntu-latest
Expand All @@ -335,6 +351,7 @@ jobs:
# Distribute on Desktop Store,

build_web:
name: Build Web Application
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -354,30 +371,40 @@ jobs:
- name: Build Web(JS) App
run: ./gradlew jsBrowserDistribution

- name: Archive Web Build
shell: pwsh
run: |
Compress-Archive -Path './mifospay-web/build/dist/js/productionExecutable/*' -DestinationPath 'web-app.zip'
- name: Upload Web Artifact
uses: actions/upload-artifact@v4
with:
name: web-app
path: 'web-app.zip'
path: './mifospay-web/build/dist/js/productionExecutable/*'

distribute_web:
name: Publish Web App
needs: [ build_web ]
if: inputs.distribute_web || inputs.release_type == 'internal'
if: inputs.distribute_web
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Download Web Artifact
uses: actions/download-artifact@v4
with:
name: web-app

# Deploy to Web Hosting
- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload static files as artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'web-app/'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

generate_release_info:
runs-on: ubuntu-latest
Expand All @@ -389,6 +416,14 @@ jobs:
with:
fetch-depth: 0

- uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- uses: ./.github/actions/create-release-number
name: Create Release Number
id: rel_number
Expand All @@ -411,7 +446,8 @@ jobs:
name: beta-changelog
path: './mifospay-android/build/outputs/changelogBeta'

release:
github_release:
name: Create Github Release
needs: [ build_android, build_desktop, build_web, build_ios ]
if: inputs.release_type == 'beta'
runs-on: ubuntu-latest
Expand All @@ -423,6 +459,11 @@ jobs:
- name: Download All Artifacts
uses: actions/download-artifact@v4

- name: Archive Web Build
shell: pwsh
run: |
Compress-Archive -Path 'web-app/*' -DestinationPath 'web-app.zip'
- name: Download Git Changelog
uses: actions/download-artifact@v4
with:
Expand All @@ -438,5 +479,5 @@ jobs:
files: |
android-app/*
desktop-app-*/*
web-app/*
web-app.zip
ios-app/*
3 changes: 0 additions & 3 deletions .github/workflows/make_site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
pull_request:
branches: [ "dev" ]
types: [ closed ]
# Trigger on new releases
release:
types: [ released ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand Down

0 comments on commit 912696a

Please sign in to comment.