ci: Migrated Windows install to winget
This commit is contained in:
@@ -356,67 +356,45 @@ jobs:
|
|||||||
path: artifacts
|
path: artifacts
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
|
||||||
|
publish-winget-package:
|
||||||
publish-chocolatey-package:
|
|
||||||
needs: [publish-github-release]
|
needs: [publish-github-release]
|
||||||
name: Publish Chocolatey Package
|
name: Publish winget package
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check if actor is repository owner
|
- name: Check if actor is repository owner
|
||||||
if: ${{ github.actor != github.repository_owner && env.ACT != 'true' }}
|
if: ${{ github.actor != github.repository_owner && env.ACT != 'true' }}
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "You are not authorized to run this workflow."
|
echo "You are not authorized to run this workflow."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
|
|
||||||
- name: Get release artifacts
|
- name: Get release artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: artifacts
|
path: artifacts
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Set release assets and version
|
- name: Set release version
|
||||||
shell: pwsh
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# Read the first column from the SHA256 file
|
release_version="$(cat ./artifacts/release-version)"
|
||||||
$windows_sha = Get-Content ./artifacts/gman-x86_64-pc-windows-msvc.sha256 | ForEach-Object { $_.Split(' ')[0] }
|
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
|
||||||
Add-Content -Path $env:GITHUB_ENV -Value "WINDOWS_SHA=$windows_sha"
|
|
||||||
|
|
||||||
# Read the release version from the release-version file
|
|
||||||
$release_version = Get-Content ./artifacts/release-version
|
|
||||||
Add-Content -Path $env:GITHUB_ENV -Value "RELEASE_VERSION=$release_version"
|
|
||||||
|
|
||||||
- name: Validate release environment variables
|
- name: Validate release environment variables
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "Release SHA windows: ${{ env.WINDOWS_SHA }}"
|
|
||||||
echo "Release version: ${{ env.RELEASE_VERSION }}"
|
echo "Release version: ${{ env.RELEASE_VERSION }}"
|
||||||
|
|
||||||
- name: Package and Publish package to Chocolatey
|
- name: Publish to winget (opens PR to microsoft/winget-pkgs)
|
||||||
if: env.ACT != 'true'
|
if: env.ACT != 'true'
|
||||||
run: |
|
uses: vedantmgoyal9/winget-releaser@v2
|
||||||
mkdir ./deployment/chocolatey/tools
|
with:
|
||||||
# Run packaging script
|
identifier: ${{ vars.WINGET_PACKAGE_IDENTIFIER }}
|
||||||
python "./deployment/chocolatey/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/chocolatey/gman.nuspec.template" "./deployment/chocolatey/gman.nuspec" ${{ env.WINDOWS_SHA }}
|
version: ${{ env.RELEASE_VERSION }}
|
||||||
python "./deployment/chocolatey/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/chocolatey/chocolateyinstall.ps1.template" "./deployment/chocolatey/tools/chocolateyinstall.ps1" ${{ env.WINDOWS_SHA }}
|
token: ${{ secrets.WINGET_TOKEN }}
|
||||||
|
installers: |
|
||||||
# Publish to Chocolatey
|
https://github.com/${{ github.repository }}/releases/download/v${{ env.RELEASE_VERSION }}/gman-x86_64-pc-windows-msvc.zip
|
||||||
cd ./deployment/chocolatey
|
https://github.com/${{ github.repository }}/releases/download/v${{ env.RELEASE_VERSION }}/gman-aarch64-pc-windows-msvc.zip
|
||||||
choco pack
|
|
||||||
choco install gman --yes -dv -s .
|
|
||||||
# Verify install succeeded
|
|
||||||
choco list --local-only | Select-String '^gman ' | Out-Null
|
|
||||||
|
|
||||||
# Run the EXE directly from the installed package folder
|
|
||||||
$exe = Get-ChildItem "$env:ChocolateyInstall\lib\gman\tools\gman*.exe" -ErrorAction Stop |
|
|
||||||
Select-Object -First 1 -ExpandProperty FullName
|
|
||||||
|
|
||||||
$version = & $exe --version
|
|
||||||
$version = $version -replace " ", "."
|
|
||||||
choco push "$version.nupkg" -s https://push.chocolatey.org/ --api-key ${{ secrets.CHOCOLATEY_API_KEY }}
|
|
||||||
|
|
||||||
publish-homebrew-formula:
|
publish-homebrew-formula:
|
||||||
needs: [publish-github-release]
|
needs: [publish-github-release]
|
||||||
|
|||||||
@@ -133,23 +133,14 @@ To upgrade `gman` using Homebrew:
|
|||||||
brew upgrade gman
|
brew upgrade gman
|
||||||
```
|
```
|
||||||
|
|
||||||
### Chocolatey (Windows)
|
### Winget (Windows)
|
||||||
The G-Man Chocolatey package is located [here](https://community.chocolatey.org/packages/gman). Please note that validation
|
To install G-Man using Winget:
|
||||||
of Chocolatey packages take quite some time, and thus the package may not be available immediately after a new release.
|
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
choco install gman
|
winget install gman
|
||||||
|
|
||||||
# Some newer releases may require a version number, so you can specify it like so:
|
# If you need to be more specific, use:
|
||||||
choco install gman --version=0.1.0
|
winget install --id Dark-Alex-17.gman
|
||||||
```
|
|
||||||
|
|
||||||
To upgrade to the latest and greatest version of G-Man:
|
|
||||||
```powershell
|
|
||||||
choco upgrade gman
|
|
||||||
|
|
||||||
# To upgrade to a specific version:
|
|
||||||
choco upgrade gman --version=0.1.0
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Manual
|
### Manual
|
||||||
|
|||||||
Reference in New Issue
Block a user