Skip to content

Commit

Permalink
Update gradle_snapshot_build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanlorng authored Oct 28, 2024
1 parent 2ef186e commit 0fa97f0
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/gradle_snapshot_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,25 @@ jobs:
type: [PublishLibrary, Android, Windows, Linux, macOS]
include:
- type: PublishLibrary
publish: release
os: macos-latest
- type: Android
android: apk
os: macos-latest
- type: Windows
desktopPackage: msi
desktop: msi
os: windows-latest
- type: Linux
desktopPackage: deb
desktop: deb
os: ubuntu-latest
- type: macOS
desktopPackage: dmg
desktop: dmg
os: macos-latest

runs-on: ${{ matrix.os }}
permissions:
contents: read
packages: write
env:
IS_PUBLISH_LIBRARY: ${{ matrix.type == 'PublishLibrary' }}
IS_BUILD_ANDROID: ${{ matrix.type == 'Android' }}

steps:
- uses: actions/checkout@v4
Expand All @@ -57,7 +56,7 @@ jobs:
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0

- name: Publish Library
if: ${{ env.IS_PUBLISH_LIBRARY }}
if: ${{ matrix.publish }}
run: |
echo "$IS_PUBLISH_LIBRARY"
# ./gradlew publishToMavenLocal
Expand All @@ -69,14 +68,14 @@ jobs:
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}

- name: Upload Library Atrifact
if: ${{ env.PUBLISH_LIBRARY }}
if: ${{ matrix.publish }}
uses: actions/upload-artifact@v4
with:
name: Repository-${{ github.run_id }}
path: ~/.m2/repository

- name: Build Gallery Android
if: ${{ env.IS_BUILD_ANDROID }}
- name: Build Gallery for ${{ matrix.type }}
if: ${{ matrix.android }}
run: |
echo "$ANDROID_KEYSTORE" | base64 --decode > ${{ github.workspace }}/android_sign_key.jks
# ./gradlew :gallery:assembleRelease
Expand All @@ -88,20 +87,20 @@ jobs:
ANDROID_SIGNING_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}

- name: Upload android build artifacts
if: ${{ env.IS_BUILD_ANDROID }}
if: ${{ matrix.android }}
uses: actions/upload-artifact@v4
with:
name: Gallery-${{ matrix.type }}-${{ github.run_id }}
path: ${{github.workspace}}/gallery/build/outputs/**/*.apk
path: ${{github.workspace}}/gallery/build/outputs/**/*.${{ matrix.android }}

- name: Build Gallery Android
if: ${{ matrix.desktopPackage }}
- name: Build Gallery for ${{ matrix.type }}
if: ${{ matrix.desktop }}
run: |
echo "$IS_BUILD_DESKTOP"
- name: Upload desktop build artifacts
if: ${{ matrix.desktopPackage }}
if: ${{ matrix.desktop }}
uses: actions/upload-artifact@v4
with:
name: Gallery-${{ matrix.type }}-${{ github.run_id }}
path: ${{github.workspace}}/gallery/build/compose/binaries/main-release/${{ matrix.desktopPackage }}/*.${{ matrix.desktopPackage }}
path: ${{github.workspace}}/gallery/build/compose/binaries/main-release/${{ matrix.desktop }}/*.${{ matrix.desktop }}

0 comments on commit 0fa97f0

Please sign in to comment.