Skip to content

Commit

Permalink
Change workflow to use Cloudflare R2
Browse files Browse the repository at this point in the history
  • Loading branch information
riverar committed Jan 5, 2025
1 parent c56110f commit cd39ab7
Showing 1 changed file with 20 additions and 33 deletions.
53 changes: 20 additions & 33 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,8 @@ jobs:
#
# Deployment: AppInstaller
#

deploy-appinstaller:
name: 🚀 Deploy AppInstaller package
name: Deploy AppInstaller package
runs-on: windows-latest
needs: appinstaller
if: |
Expand All @@ -436,39 +435,27 @@ jobs:
name: AppInstaller
path: .

- name: Log into Azure
uses: azure/login@v2
- name: Configure credentials
uses: aws-actions/configure-aws-credentials@v4
with:
creds: '{"clientId":"${{ secrets.azure_storage_client_id }}","clientSecret":"${{ secrets.azure_storage_client_secret }}","subscriptionId":"${{ secrets.azure_storage_subscription_id }}","tenantId":"${{ secrets.azure_tenant_id }}"}'
enable-AzPSSession: true
aws-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
aws-region: auto

- name: Upload blob to Azure Storage
uses: azure/powershell@v2
with:
azPSVersion: 'latest'
inlineScript: >
$context =
New-AzStorageContext
-StorageAccountName eartrumpetstorage
-UseConnectedAccount
Get-ChildItem -File EarTrumpet.Package_*_x86_x64_arm64.msixbundle | ForEach-Object {
Set-AzStorageBlobContent `
-File $_.FullName `
-Container builds `
-Blob ('${{ github.ref_name }}/' + $_.Name) `
-Context $context `
-Properties @{ContentType = "application/msixbundle";} `
-Force
}
Set-AzStorageBlobContent
-File EarTrumpet.Package.appinstaller
-Blob '${{ github.ref_name }}/EarTrumpet.Package.appinstaller'
-Container builds
-Context $context
-Properties @{ContentType = "application/appinstaller";} `
-Force
- name: Upload files to Cloudflare
shell: pwsh
run: |
# Upload MSIX bundle
Get-ChildItem -File EarTrumpet.Package_*_x86_x64_arm64.msixbundle | ForEach-Object {
aws s3 cp $_.FullName "s3://${{ secrets.R2_BUCKET_NAME }}/${{ github.ref_name }}/$($_.Name)" `
--content-type "application/msixbundle" `
--endpoint-url "https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com"
}
# Upload appinstaller file
aws s3 cp EarTrumpet.Package.appinstaller "s3://${{ secrets.R2_BUCKET_NAME }}/${{ github.ref_name }}/EarTrumpet.Package.appinstaller" `
--content-type "application/appinstaller" `
--endpoint-url "https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com"
#
# Deployment: Microsoft Store
Expand Down

0 comments on commit cd39ab7

Please sign in to comment.