diff --git a/.github/workflows/microsoft_store.yml b/.github/workflows/microsoft_store.yml index b689c594da42..5105c6e53b11 100644 --- a/.github/workflows/microsoft_store.yml +++ b/.github/workflows/microsoft_store.yml @@ -32,21 +32,21 @@ jobs: product-update: '{ "packages":[ { - "packageUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v${{ github.event.inputs.version }}/install-x64.msi", + "packageUrl":"https://cdn.ohmyposh.dev/releases/v${{ github.event.inputs.version }}/install-x64.msi", "languages":["en"], "architectures":["X64"], "installerParameters":"/quiet INSTALLER=ws", "isSilentInstall":false }, { - "packageUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v${{ github.event.inputs.version }}/install-arm64.msi", + "packageUrl":"https://cdn.ohmyposh.dev/releases/v${{ github.event.inputs.version }}/install-arm64.msi", "languages":["en"], "architectures":["Arm64"], "installerParameters":"/quiet INSTALLER=ws", "isSilentInstall":false }, { - "packageUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v${{ github.event.inputs.version }}/install-x86.msi", + "packageUrl":"https://cdn.ohmyposh.dev/releases/v${{ github.event.inputs.version }}/install-x86.msi", "languages":["en"], "architectures":["X86"], "installerParameters":"/quiet INSTALLER=ws", diff --git a/.github/workflows/msi.yml b/.github/workflows/msi.yml index 546bd5821f04..26fca151532d 100644 --- a/.github/workflows/msi.yml +++ b/.github/workflows/msi.yml @@ -24,35 +24,10 @@ jobs: AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} + CDN_CONNECTIONSTRING: ${{ secrets.CDN_CONNECTIONSTRING }} run: | $version = $env:GITHUB_REF.TrimStart("refs/tags/v") - ./build.ps1 -Architecture ${{ matrix.arch }} -Version $version -Download -Sign - - name: Upload artifacts 🆙 - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - console.log('environment', process.versions); - - const fs = require('fs').promises; - - const { repo: { owner, repo }, sha } = context; - console.log({ owner, repo, sha }); - - for (let file of await fs.readdir('./packages/msi/out')) { - if (file.indexOf(".msi") < 0) { - continue; - } - - console.log('uploading', file); - - await github.rest.repos.uploadReleaseAsset({ - owner, repo, - release_id: ${{ github.event.release.id }}, - name: file, - data: await fs.readFile(`./packages/msi/out/${file}`) - }); - } + ./build.ps1 -Architecture ${{ matrix.arch }} -Version $version -Download -Sign -Upload notify: runs-on: ubuntu-latest needs: package diff --git a/packages/msi/build.ps1 b/packages/msi/build.ps1 index f0bee4197034..b73d8b8602fb 100644 --- a/packages/msi/build.ps1 +++ b/packages/msi/build.ps1 @@ -10,7 +10,8 @@ Param [string] $SDKVersion = "10.0.22621.0", [switch]$Download, - [switch]$Sign + [switch]$Sign, + [switch]$Upload ) $PSDefaultParameterValues['Out-File:Encoding'] = 'UTF8' @@ -35,7 +36,8 @@ if ($Download) { $env:VERSION = $Version # create MSI -$installer = "./out/install-$Architecture.msi" +$fileName = "install-$Architecture.msi" +$installer = "./out/$fileName" wix build -arch $Architecture -out $installer .\oh-my-posh.wxs if ($Sign) { @@ -55,3 +57,9 @@ if ($Sign) { # get hash $zipHash = Get-FileHash $installer -Algorithm SHA256 $zipHash.Hash | Out-File -Encoding 'UTF8' "$installer.sha256" + +if (-not $Upload) { + exit +} + +az storage blob upload --container-name "v$Version" --file $installer --name $fileName --connection-string $env.CDN_CONNECTIONSTRING diff --git a/packages/scoop/oh-my-posh.json b/packages/scoop/oh-my-posh.json index 9479930d42bf..16ee1fd511ad 100644 --- a/packages/scoop/oh-my-posh.json +++ b/packages/scoop/oh-my-posh.json @@ -8,11 +8,11 @@ }, "architecture": { "64bit": { - "url": "https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v/install-x64.msi", + "url": "https://cdn.ohmyposh.dev/releases/v/install-x64.msi", "hash": "" }, "32bit": { - "url": "https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v/install-x86.msi", + "url": "https://cdn.ohmyposh.dev/releases/v/install-x86.msi", "hash": "" } }, diff --git a/packages/winget/JanDeDobbeleer.OhMyPosh.installer.yaml b/packages/winget/JanDeDobbeleer.OhMyPosh.installer.yaml index 53f542bface3..5459dbf3cb7b 100644 --- a/packages/winget/JanDeDobbeleer.OhMyPosh.installer.yaml +++ b/packages/winget/JanDeDobbeleer.OhMyPosh.installer.yaml @@ -11,42 +11,42 @@ InstallModes: - silentWithProgress Installers: - Architecture: x64 - InstallerUrl: https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v/install-x64.msi + InstallerUrl: https://cdn.ohmyposh.dev/releases/v/install-x64.msi InstallerSha256: Scope: machine UpgradeBehavior: install InstallerSwitches: Custom: INSTALLER=winget ALLUSERS=1 - Architecture: x64 - InstallerUrl: https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v/install-x64.msi + InstallerUrl: https://cdn.ohmyposh.dev/releases/v/install-x64.msi InstallerSha256: Scope: user UpgradeBehavior: install InstallerSwitches: Custom: INSTALLER=winget - Architecture: x86 - InstallerUrl: https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v/install-x86.msi + InstallerUrl: https://cdn.ohmyposh.dev/releases/v/install-x86.msi InstallerSha256: Scope: machine UpgradeBehavior: install InstallerSwitches: Custom: INSTALLER=winget ALLUSERS=1 - Architecture: x86 - InstallerUrl: https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v/install-x86.msi + InstallerUrl: https://cdn.ohmyposh.dev/releases/v/install-x86.msi InstallerSha256: Scope: user UpgradeBehavior: install InstallerSwitches: Custom: INSTALLER=winget - Architecture: arm64 - InstallerUrl: https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v/install-arm64.msi + InstallerUrl: https://cdn.ohmyposh.dev/releases/v/install-arm64.msi InstallerSha256: Scope: machine UpgradeBehavior: install InstallerSwitches: Custom: INSTALLER=winget ALLUSERS=1 - Architecture: arm64 - InstallerUrl: https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v/install-arm64.msi + InstallerUrl: https://cdn.ohmyposh.dev/releases/v/install-arm64.msi InstallerSha256: Scope: user UpgradeBehavior: install