Skip to content

Commit f7237cf

Browse files
committed
GHA: automate release creation for re-use of artifacts
The release artifacts are very helpful for running other GHA pipelines (e.g. swift-firebase). Automate the release creation to avoid having to manually upload the release content.
1 parent f6d6ee2 commit f7237cf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/bcny-firebase.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,18 @@ jobs:
132132
name: firebase-windows-${{ matrix.arch }}
133133
path: ${{ github.workspace }}/BuildRoot/Library/firebase
134134

135+
- name: Create Release
136+
env:
137+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
138+
run: |
139+
Compress-Archive -Path "${{ github.workspace }}/BuildRoot/Library/firebase" -DestinationPath firebase-windows-${{ matrix.arch }}.zip
140+
$SHA256 = Get-FileHash -Path firebase-windows-${{ matrix.arch }}.zip -Algorithm SHA256 > firebase-windows-${{ matrix.arch }}.zip.sha256
141+
$Date = Get-Date -Format 'yyyyMMdd'
142+
$Release = $(gh release list -R ${{ github.repository }} | Select-String -Pattern $Date -AllMatches).Count
143+
gh release create "$Date.$Release" -R ${{ github.repository }}
144+
gh release upload "$Date.$Release" firebase-windows-${{ matrix.arch }}.zip -R ${{ github.repository }}
145+
gh release upload "$Date.$Release" firebase-windows-${{ matrix.arch }}.zip.sha256 -R ${{ github.repository }}
146+
135147
- name: Package firebase-cpp-sdk
136148
run: |
137149
@"

0 commit comments

Comments
 (0)