Skip to content

Commit 1b37356

Browse files
compnerdkendalharland
authored andcommitted
GHA: unify the release step for all the platforms
Rather than have 3 different releases for a single build, unify the releases into a single step so that we have a single unit of release for the platform and architecture combinations.
1 parent 42ea1bf commit 1b37356

File tree

1 file changed

+28
-17
lines changed

1 file changed

+28
-17
lines changed

.github/workflows/bcny-firebase.yml

+28-17
Original file line numberDiff line numberDiff line change
@@ -142,19 +142,6 @@ jobs:
142142
name: firebase-windows-${{ matrix.arch }}
143143
path: ${{ github.workspace }}/BuildRoot/Library/firebase
144144

145-
- name: Create Release
146-
if: github.event_name != 'pull_request'
147-
env:
148-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
149-
run: |
150-
Compress-Archive -Path "${{ github.workspace }}/BuildRoot/Library/firebase" -DestinationPath firebase-windows-${{ matrix.arch }}.zip
151-
$SHA256 = Get-FileHash -Path firebase-windows-${{ matrix.arch }}.zip -Algorithm SHA256 > firebase-windows-${{ matrix.arch }}.zip.sha256
152-
$Date = Get-Date -Format 'yyyyMMdd'
153-
$Release = $(gh release list -R ${{ github.repository }} | Select-String -Pattern $Date -AllMatches).Count
154-
gh release create "$Date.$Release" -R ${{ github.repository }}
155-
gh release upload "$Date.$Release" firebase-windows-${{ matrix.arch }}.zip -R ${{ github.repository }}
156-
gh release upload "$Date.$Release" firebase-windows-${{ matrix.arch }}.zip.sha256 -R ${{ github.repository }}
157-
158145
- name: Print built libraries
159146
run: Get-ChildItem -Recurse -Name -Path ${{ github.workspace }}\BuildRoot\Library\firebase -Include *.lib
160147

@@ -451,8 +438,8 @@ jobs:
451438
name: firebase-android-${{ matrix.arch }}
452439
path: ${{ github.workspace }}/BuildRoot/Library/firebase
453440

454-
release_android:
455-
needs: [android]
441+
release:
442+
needs: [windows,android]
456443
if: github.event_name != 'pull_request'
457444
runs-on: windows-latest
458445
steps:
@@ -468,19 +455,43 @@ jobs:
468455
name: firebase-android-x86_64
469456
path: ${{ github.workspace }}/firebase-android-x86_64
470457

458+
- name: Download firebase-windows-amd64 artifact
459+
uses: actions/download-artifact@v3
460+
with:
461+
name: firebase-windows-amd64
462+
path: ${{ github.workspace }}/firebase-windows-amd64
463+
464+
- name: Download firebase-windows-arm64 artifact
465+
uses: actions/download-artifact@v3
466+
with:
467+
name: firebase-windows-arm64
468+
path: ${{ github.workspace }}/firebase-windows-arm64
469+
471470
- name: Create Release
472471
env:
473472
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
474473
run: |
475474
Compress-Archive -Path "${{ github.workspace }}/firebase-android-arm64-v8a" -DestinationPath firebase-android-arm64-v8a.zip
476-
$SHA256_arm64 = Get-FileHash -Path firebase-android-arm64-v8a.zip -Algorithm SHA256 > firebase-android-arm64-v8a.zip.sha256
475+
Get-FileHash -Path firebase-android-arm64-v8a.zip -Algorithm SHA256 > firebase-android-arm64-v8a.zip.sha256
476+
477477
Compress-Archive -Path "${{ github.workspace }}/firebase-android-x86_64" -DestinationPath firebase-android-x86_64.zip
478-
$SHA256_x86_64 = Get-FileHash -Path firebase-android-x86_64.zip -Algorithm SHA256 > firebase-android-x86_64.zip.sha256
478+
Get-FileHash -Path firebase-android-x86_64.zip -Algorithm SHA256 > firebase-android-x86_64.zip.sha256
479+
480+
Compress-Archive -Path "${{ github.workspace }}/firebase-windows-amd64" -DestinationPath firebase-windows-amd64.zip
481+
Get-FileHash -Path firebase-windows-amd64.zip -Algorithm SHA256 > firebase-windows-amd64.zip.sha256
482+
483+
Compress-Archive -Path "${{ github.workspace }}/firebase-windows-arm64" -DestinationPath firebase-windows-arm64.zip
484+
Get-FileHash -Path firebase-windows-arm64.zip -Algorithm SHA256 > firebase-windows-arm64.zip.sha256
485+
479486
$Date = Get-Date -Format 'yyyyMMdd'
480487
$Release = $(gh release list -R ${{ github.repository }} | Select-String -Pattern $Date -AllMatches).Count
481488
gh release create "$Date.$Release" -R ${{ github.repository }}
482489
gh release upload "$Date.$Release" firebase-android-arm64-v8a.zip -R ${{ github.repository }}
483490
gh release upload "$Date.$Release" firebase-android-arm64-v8a.zip.sha256 -R ${{ github.repository }}
484491
gh release upload "$Date.$Release" firebase-android-x86_64.zip -R ${{ github.repository }}
485492
gh release upload "$Date.$Release" firebase-android-x86_64.zip.sha256 -R ${{ github.repository }}
493+
gh release upload "$Date.$Release" firebase-windows-amd64.zip -R ${{ github.repository }}
494+
gh release upload "$Date.$Release" firebase-windows-amd64.zip.sha256 -R ${{ github.repository }}
495+
gh release upload "$Date.$Release" firebase-windows-arm64.zip -R ${{ github.repository }}
496+
gh release upload "$Date.$Release" firebase-windows-arm64.zip.sha256 -R ${{ github.repository }}
486497

0 commit comments

Comments
 (0)