From ba148a4639d887f9e82cbd9f16b8685f05d3f7b5 Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Sun, 24 Nov 2024 19:26:53 +0100 Subject: [PATCH] chore: remove inno package --- .github/workflows/inno.yml | 90 ------------------------------------ .github/workflows/msi.yml | 41 ++++++++++++++++ packages/inno/build.ps1 | 50 -------------------- packages/inno/oh-my-posh.iss | 48 ------------------- 4 files changed, 41 insertions(+), 188 deletions(-) delete mode 100644 .github/workflows/inno.yml delete mode 100644 packages/inno/build.ps1 delete mode 100644 packages/inno/oh-my-posh.iss diff --git a/.github/workflows/inno.yml b/.github/workflows/inno.yml deleted file mode 100644 index 4a0a1798..00000000 --- a/.github/workflows/inno.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Inno -on: - release: - types: [published] - -jobs: - publish: - runs-on: windows-latest - strategy: - matrix: - arch: [amd64, arm64, 386] - defaults: - run: - shell: pwsh - working-directory: ${{ github.workspace }}/packages/inno - steps: - - name: Checkout code 👋 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - name: Build installer 📦 - id: build - env: - AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} - AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} - AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} - run: | - $version = $env:GITHUB_REF.TrimStart("refs/tags/v") - ./build.ps1 -Architecture ${{ matrix.arch }} -Version $version - - 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/inno/Output')) { - console.log('uploading', file); - - await github.rest.repos.uploadReleaseAsset({ - owner, repo, - release_id: ${{ github.event.release.id }}, - name: file, - data: await fs.readFile(`./packages/inno/Output/${file}`) - }); - } - notify: - runs-on: ubuntu-latest - needs: publish - steps: - - name: Notify Winget Build 🙋🏾‍♀️ - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea - with: - github-token: ${{ secrets.GH_PAT }} - script: | - await github.request('POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches', { - owner: 'jandedobbeleer', - repo: '${{ github.event.repository.name }}', - workflow_id: 'winget.yml', - ref: 'main', - inputs: {"version": process.env.GITHUB_REF.replace('refs/tags/v', '')} - }) - - name: Notify Windows Store Build 👋 - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea - with: - github-token: ${{ secrets.GH_PAT }} - script: | - await github.request('POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches', { - owner: 'jandedobbeleer', - repo: '${{ github.event.repository.name }}', - workflow_id: 'microsoft_store.yml', - ref: 'main', - inputs: {"version": process.env.GITHUB_REF.replace('refs/tags/v', '')} - }) - - name: Notify Scoop Build 🤙 - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea - with: - github-token: ${{ secrets.GH_PAT }} - script: | - await github.request('POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches', { - owner: 'jandedobbeleer', - repo: '${{ github.event.repository.name }}', - workflow_id: 'scoop.yml', - ref: 'main', - inputs: {"version": process.env.GITHUB_REF.replace('refs/tags/v', ''), "release": "${{ github.event.release.id }}" } - }) - diff --git a/.github/workflows/msi.yml b/.github/workflows/msi.yml index 3b3f073e..d0eface4 100644 --- a/.github/workflows/msi.yml +++ b/.github/workflows/msi.yml @@ -53,3 +53,44 @@ jobs: data: await fs.readFile(`./packages/msi/out/${file}`) }); } + notify: + runs-on: ubuntu-latest + needs: package + steps: + - name: Notify Winget Build 🙋🏾‍♀️ + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea + with: + github-token: ${{ secrets.GH_PAT }} + script: | + await github.request('POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches', { + owner: 'jandedobbeleer', + repo: '${{ github.event.repository.name }}', + workflow_id: 'winget.yml', + ref: 'main', + inputs: {"version": process.env.GITHUB_REF.replace('refs/tags/v', '')} + }) + - name: Notify Windows Store Build 👋 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea + with: + github-token: ${{ secrets.GH_PAT }} + script: | + await github.request('POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches', { + owner: 'jandedobbeleer', + repo: '${{ github.event.repository.name }}', + workflow_id: 'microsoft_store.yml', + ref: 'main', + inputs: {"version": process.env.GITHUB_REF.replace('refs/tags/v', '')} + }) + - name: Notify Scoop Build 🤙 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea + with: + github-token: ${{ secrets.GH_PAT }} + script: | + await github.request('POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches', { + owner: 'jandedobbeleer', + repo: '${{ github.event.repository.name }}', + workflow_id: 'scoop.yml', + ref: 'main', + inputs: {"version": process.env.GITHUB_REF.replace('refs/tags/v', ''), "release": "${{ github.event.release.id }}" } + }) + diff --git a/packages/inno/build.ps1 b/packages/inno/build.ps1 deleted file mode 100644 index ff3463aa..00000000 --- a/packages/inno/build.ps1 +++ /dev/null @@ -1,50 +0,0 @@ -Param -( - [parameter(Mandatory = $true)] - [ValidateSet('amd64', 'arm64', '386')] - [System.String]$Architecture, - [parameter(Mandatory = $true)] - [string] - $Version, - [parameter(Mandatory = $false)] - [string] - $SDKVersion = "10.0.22621.0" -) - -$PSDefaultParameterValues['Out-File:Encoding']='UTF8' - -# setup dependencies -nuget.exe install Microsoft.Trusted.Signing.Client -Version 1.0.60 -x -$signtoolDlib = "$PWD/Microsoft.Trusted.Signing.Client/bin/x64/Azure.CodeSigning.Dlib.dll" -$signtool = "C:/Program Files (x86)/Windows Kits/10/bin/$SDKVersion/x64/signtool.exe" - -New-Item -Path "." -Name "bin" -ItemType Directory -ErrorAction SilentlyContinue -Copy-Item -Path "../../themes" -Destination "./bin" -Recurse - -# download the executable -$file = "posh-windows-$Architecture.exe" -$name = "oh-my-posh.exe" -$download = "https://github.com/jandedobbeleer/oh-my-posh/releases/download/v$Version/$($file)" -Invoke-WebRequest $download -Out "./bin/$($name)" - -# license -Invoke-WebRequest "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/v$Version/COPYING" -Out "./bin/COPYING.txt" -$content = Get-Content '.\oh-my-posh.iss' -Raw -$content = $content.Replace('', $Version) -$ISSName = ".oh-my-posh-$Architecture-$Version.iss" -$content | Out-File -Encoding 'UTF8' $ISSName - -# clean paths -$signtool = $signtool -Replace '\\', '/' -$signtoolDlib = $signtoolDlib -Replace '\\', '/' - -# package content -$installer = "install-$Architecture" -ISCC.exe /F$installer $ISSName - -# sign installer -& "$signtool" sign /v /debug /fd SHA256 /tr 'http://timestamp.acs.microsoft.com' /td SHA256 /dlib "$signtoolDlib" /dmdf ../../src/metadata.json "./Output/$installer.exe" - -# get hash -$zipHash = Get-FileHash "Output/$installer.exe" -Algorithm SHA256 -$zipHash.Hash | Out-File -Encoding 'UTF8' "Output/$installer.exe.sha256" diff --git a/packages/inno/oh-my-posh.iss b/packages/inno/oh-my-posh.iss deleted file mode 100644 index 9db7e8a7..00000000 --- a/packages/inno/oh-my-posh.iss +++ /dev/null @@ -1,48 +0,0 @@ -[Setup] -AppName=Oh My Posh -AppVersion= -VersionInfoVersion= -DefaultDirName={autopf}\oh-my-posh -DefaultGroupName=Oh My Posh -AppPublisher=Jan De Dobbeleer -AppPublisherURL=https://ohmyposh.dev -AppSupportURL=https://github.com/JanDeDobbeleer/oh-my-posh/issues -LicenseFile="bin\COPYING.txt" -OutputBaseFilename=install -UninstallDisplayIcon={app}\bin\oh-my-posh.exe -PrivilegesRequired=lowest -PrivilegesRequiredOverridesAllowed=dialog -ChangesEnvironment=yes -CloseApplications=no - -[Files] -Source: "bin\oh-my-posh.exe"; DestDir: "{app}\bin" -Source: "bin\themes\*"; DestDir: "{app}\themes" - -[Registry] -Root: "HKA"; Subkey: "{code:GetEnvironmentKey}"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}\bin"; Check: NeedsAddPathHKA(ExpandConstant('{app}\bin')) -Root: "HKA"; Subkey: "{code:GetEnvironmentKey}"; ValueType: string; ValueName: "POSH_THEMES_PATH"; ValueData: {app}\themes; Flags: preservestringtype -Root: "HKA"; Subkey: "{code:GetEnvironmentKey}"; ValueType: string; ValueName: "POSH_INSTALLER"; ValueData: {param:installer|manual}; Flags: preservestringtype - -[Code] -function GetEnvironmentKey(Param: string): string; -begin - if IsAdminInstallMode then - Result := 'System\CurrentControlSet\Control\Session Manager\Environment' - else - Result := 'Environment'; -end; - -function NeedsAddPathHKA(Param: string): boolean; -var - OrigPath: string; -begin - if not RegQueryStringValue(HKA, GetEnvironmentKey(''), 'Path', OrigPath) - then begin - Result := True; - exit; - end; - // look for the path with leading and trailing semicolon - // Pos() returns 0 if not found - Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0; -end;