Skip to content

Commit

Permalink
Merge pull request #12069 from rtibbles/release_upload
Browse files Browse the repository at this point in the history
Next attempt at fixing GCS upload
  • Loading branch information
rtibbles authored May 3, 2024
2 parents 54dd2c7 + db3678e commit f3c787d
Showing 1 changed file with 40 additions and 26 deletions.
66 changes: 40 additions & 26 deletions .github/workflows/release_kolibri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,38 @@ jobs:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
TESTPYPI_API_TOKEN: ${{ secrets.TESTPYPI_API_TOKEN }}
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
gcs_upload:
name: Upload to Google Cloud Storage for LE Downloads
runs-on: ubuntu-latest
needs: [whl, pex, dmg, deb, exe, zip, apk]
strategy:
matrix:
filename: [
'${{ needs.whl.outputs.whl-file-name }}',
'${{ needs.whl.outputs.tar-file-name }}',
'${{ needs.pex.outputs.pex-file-name }}',
'${{ needs.dmg.outputs.dmg-file-name }}',
'${{ needs.deb.outputs.deb-file-name }}',
'${{ needs.exe.outputs.exe-file-name }}',
'${{ needs.zip.outputs.zip-file-name }}',
'${{ needs.apk.outputs.apk-file-name }}',
]
steps:
- name: Download ${{ matrix.filename }} artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.filename }}
path: dist
- uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GH_UPLOADER_GCP_SA_CREDENTIALS }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
- name: Upload files to Google Cloud Storage
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: 'dist/${{ matrix.filename }}'
destination: '${{ secrets.KOLIBRI_PUBLIC_RELEASE_GCS_BUCKET }}/downloads/kolibri/${{ github.event.release.name }}'
block_release_step:
# This step ties to the release environment which requires manual approval
# before it can execute. Once manual approval has been granted, the release is
Expand All @@ -153,45 +185,27 @@ jobs:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
TESTPYPI_API_TOKEN: ${{ secrets.TESTPYPI_API_TOKEN }}
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
gcs_upload:
name: Upload to Google Cloud Storage
if: ${{ !github.event.release.prerelease }}
bck_gcs_upload:
name: Upload WHL file to Google Cloud Storage for BCK
if: ${{ !github.event.release.prerelease && github.event.release.name == 'latest'}}
runs-on: ubuntu-latest
needs: [block_release_step, whl, pex, dmg, deb, exe, zip, apk]
strategy:
matrix:
filename: [
'${{ needs.whl.outputs.whl-file-name }}',
'${{ needs.whl.outputs.tar-file-name }}',
'${{ needs.pex.outputs.pex-file-name }}',
'${{ needs.dmg.outputs.dmg-file-name }}',
'${{ needs.deb.outputs.deb-file-name }}',
'${{ needs.exe.outputs.exe-file-name }}',
'${{ needs.zip.outputs.zip-file-name }}',
'${{ needs.apk.outputs.apk-file-name }}',
]
needs: [block_release_step, whl]
steps:
- name: Download ${{ matrix.filename }} artifact
- name: Download WHL artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.filename }}
name: ${{ needs.whl.outputs.whl-file-name }}
path: dist
- uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GH_UPLOADER_GCP_SA_CREDENTIALS }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
- name: Upload files to Google Cloud Storage
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: 'dist/${{ matrix.filename }}/${{ matrix.filename }}'
destination: '${{ secrets.KOLIBRI_PUBLIC_RELEASE_GCS_BUCKET }}/downloads/kolibri/${{ github.event.release.name }}/${{ matrix.filename }}'
- name: Upload to BCK bucket
if: ${{ github.event.release.name == 'latest' }} && ${{ endsWith(matrix.filename, '.whl') }}
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: 'dist/${{ matrix.filename }}/${{ matrix.filename }}'
destination: '${{ secrets.BCK_PROD_BUILD_ARTIFACT_GCS_BUCKET }}/${{ matrix.filename }}'
path: 'dist/${{ needs.whl.outputs.whl-file-name }}'
destination: '${{ secrets.BCK_PROD_BUILD_ARTIFACT_GCS_BUCKET }}'
android_release:
name: Release Android App
if: ${{ !github.event.release.prerelease }}
Expand Down

0 comments on commit f3c787d

Please sign in to comment.