ci: Update the winget release step so that it works for brand new packages
This commit is contained in:
@@ -359,15 +359,19 @@ jobs:
|
|||||||
publish-winget-package:
|
publish-winget-package:
|
||||||
needs: [publish-github-release]
|
needs: [publish-github-release]
|
||||||
name: Publish winget package
|
name: Publish winget package
|
||||||
runs-on: windows-latest
|
runs-on: ubuntu-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:
|
||||||
@@ -381,19 +385,128 @@ jobs:
|
|||||||
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
|
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Validate release environment variables
|
- name: Validate release environment variables
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
echo "Release version: ${{ env.RELEASE_VERSION }}"
|
echo "Release version: ${{ env.RELEASE_VERSION }}"
|
||||||
|
|
||||||
|
- name: Check if winget package already exists
|
||||||
|
id: check
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
IDENTIFIER: DarkAlex17.GMan
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
publisher=${IDENTIFIER%%.*}
|
||||||
|
pkgname=${IDENTIFIER#*.}
|
||||||
|
first_letter=${publisher:0:1}
|
||||||
|
api_url="https://api.github.com/repos/microsoft/winget-pkgs/contents/manifests/$first_letter/$publisher/$pkgname"
|
||||||
|
status=$(curl -s -o /dev/null -w "%{http_code}" "$api_url")
|
||||||
|
if [[ "$status" == "200" ]]; then
|
||||||
|
echo "exists=true" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "exists=false" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Prepare manifests for first submission
|
||||||
|
if: steps.check.outputs.exists == 'false' && env.ACT != 'true'
|
||||||
|
env:
|
||||||
|
IDENTIFIER: DarkAlex17.GMan
|
||||||
|
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
|
||||||
|
REPO: ${{ github.repository }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
publisher=${IDENTIFIER%%.*}
|
||||||
|
pkgname=${IDENTIFIER#*.}
|
||||||
|
desc="$(grep -m1 '^description\s*=\s*"' Cargo.toml | sed -E 's/^[^\"]+\"(.*)\"/\1/')"
|
||||||
|
license="$(grep -m1 '^license\s*=\s*"' Cargo.toml | sed -E 's/^[^\"]+\"(.*)\"/\1/')"
|
||||||
|
|
||||||
|
# Compute SHAs from artifacts
|
||||||
|
x64_sha=$(awk '{print $1}' artifacts/gman-x86_64-pc-windows-msvc.sha256)
|
||||||
|
arm64_sha=$(awk '{print $1}' artifacts/gman-aarch64-pc-windows-msvc.sha256)
|
||||||
|
|
||||||
|
# Release URLs
|
||||||
|
url_x64="https://github.com/$REPO/releases/download/v$RELEASE_VERSION/gman-x86_64-pc-windows-msvc.zip"
|
||||||
|
url_arm64="https://github.com/$REPO/releases/download/v$RELEASE_VERSION/gman-aarch64-pc-windows-msvc.zip"
|
||||||
|
|
||||||
|
# Create temporary manifest directory
|
||||||
|
root="winget-manifests/manifests/${publisher:0:1}/$publisher/$pkgname/$RELEASE_VERSION"
|
||||||
|
mkdir -p "$root"
|
||||||
|
|
||||||
|
cat > "$root/$IDENTIFIER.yaml" <<YAML
|
||||||
|
PackageIdentifier: $IDENTIFIER
|
||||||
|
PackageVersion: $RELEASE_VERSION
|
||||||
|
DefaultLocale: en-US
|
||||||
|
ManifestType: version
|
||||||
|
ManifestVersion: 1.6.0
|
||||||
|
YAML
|
||||||
|
|
||||||
|
cat > "$root/$IDENTIFIER.locale.en-US.yaml" <<YAML
|
||||||
|
PackageIdentifier: $IDENTIFIER
|
||||||
|
PackageVersion: $RELEASE_VERSION
|
||||||
|
PackageLocale: en-US
|
||||||
|
Publisher: $publisher
|
||||||
|
PackageName: $pkgname
|
||||||
|
Moniker: gman
|
||||||
|
License: $license
|
||||||
|
ShortDescription: $desc
|
||||||
|
PublisherUrl: https://github.com/$publisher
|
||||||
|
PackageUrl: https://github.com/$REPO
|
||||||
|
ManifestType: defaultLocale
|
||||||
|
ManifestVersion: 1.6.0
|
||||||
|
YAML
|
||||||
|
|
||||||
|
cat > "$root/$IDENTIFIER.installer.yaml" <<YAML
|
||||||
|
PackageIdentifier: $IDENTIFIER
|
||||||
|
PackageVersion: $RELEASE_VERSION
|
||||||
|
InstallerType: zip
|
||||||
|
Installers:
|
||||||
|
- Architecture: x64
|
||||||
|
InstallerUrl: $url_x64
|
||||||
|
InstallerSha256: $x64_sha
|
||||||
|
NestedInstallerType: portable
|
||||||
|
NestedInstallerFiles:
|
||||||
|
- RelativeFilePath: gman.exe
|
||||||
|
PortableCommandAlias: gman
|
||||||
|
- Architecture: arm64
|
||||||
|
InstallerUrl: $url_arm64
|
||||||
|
InstallerSha256: $arm64_sha
|
||||||
|
NestedInstallerType: portable
|
||||||
|
NestedInstallerFiles:
|
||||||
|
- RelativeFilePath: gman.exe
|
||||||
|
PortableCommandAlias: gman
|
||||||
|
ManifestType: installer
|
||||||
|
ManifestVersion: 1.6.0
|
||||||
|
YAML
|
||||||
|
|
||||||
|
echo "Prepared manifests in $root"
|
||||||
|
|
||||||
|
- name: Install .NET for WingetCreate
|
||||||
|
if: steps.check.outputs.exists == 'false' && env.ACT != 'true'
|
||||||
|
uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
dotnet-version: '8.0.x'
|
||||||
|
|
||||||
|
- name: Install WingetCreate tool
|
||||||
|
if: steps.check.outputs.exists == 'false' && env.ACT != 'true'
|
||||||
|
run: |
|
||||||
|
dotnet tool install --global wingetcreate
|
||||||
|
echo "$HOME/.dotnet/tools" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
- name: Submit initial package to winget-pkgs
|
||||||
|
if: steps.check.outputs.exists == 'false' && env.ACT != 'true'
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ secrets.WINGET_GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
wingetcreate submit winget-manifests/manifests --submit --token "$TOKEN" --owner microsoft
|
||||||
|
|
||||||
- name: Publish to winget (opens PR to microsoft/winget-pkgs)
|
- name: Publish to winget (opens PR to microsoft/winget-pkgs)
|
||||||
if: env.ACT != 'true'
|
if: steps.check.outputs.exists == 'true' && env.ACT != 'true'
|
||||||
uses: vedantmgoyal9/winget-releaser@v2
|
uses: vedantmgoyal2009/winget-releaser@v2
|
||||||
with:
|
with:
|
||||||
identifier: DarkAlex17.GMan
|
identifier: DarkAlex17.GMan
|
||||||
version: ${{ env.RELEASE_VERSION }}
|
version: ${{ env.RELEASE_VERSION }}
|
||||||
release-tag: v${{ env.RELEASE_VERSION }}
|
release-tag: v${{ env.RELEASE_VERSION }}
|
||||||
token: ${{ secrets.WINGET_GITHUB_TOKEN }}
|
token: ${{ secrets.WINGET_TOKEN }}
|
||||||
installers-regex: 'gman-x86_64-pc-windows-msvc.exe$'
|
|
||||||
|
|
||||||
publish-homebrew-formula:
|
publish-homebrew-formula:
|
||||||
needs: [publish-github-release]
|
needs: [publish-github-release]
|
||||||
|
|||||||
@@ -6,42 +6,3 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [0.0.1] - 2025-09-10
|
## [0.0.1] - 2025-09-10
|
||||||
|
|
||||||
## v0.1.0 (2025-09-15)
|
|
||||||
|
|
||||||
### Feat
|
|
||||||
|
|
||||||
- Subcommand to edit the config directly instead of having to find the file
|
|
||||||
|
|
||||||
### Fix
|
|
||||||
|
|
||||||
- improved user messages for local provider sync set up
|
|
||||||
- Pass the changelog to the GHA properly using a file
|
|
||||||
- Potential bug in changelog variable generation
|
|
||||||
- Revert back hacky stuff so I can test with act now
|
|
||||||
- Attempting to use pre-generated bindgens for the aws-lc-sys library
|
|
||||||
- Install openSSL differently to make this work
|
|
||||||
- Address edge case for unknown_musl targets
|
|
||||||
- Install LLVM prereqs for release flow
|
|
||||||
- Updated the release flow to install the external bindgen-cli
|
|
||||||
|
|
||||||
## v0.0.1 (2025-09-12)
|
|
||||||
|
|
||||||
### Feat
|
|
||||||
|
|
||||||
- Azure Key Vault support
|
|
||||||
- GCP Secret Manager support
|
|
||||||
- Full AWS SecretsManager support
|
|
||||||
- AWS Secrets Manager support
|
|
||||||
- Added two new flags to output where gman writes logs to and where it expects the config file to live
|
|
||||||
|
|
||||||
### Fix
|
|
||||||
|
|
||||||
- Made the vault file location more fault tolerant
|
|
||||||
- Attempting to maybe be a bit more explicit about config file handling to fix MacOS tests
|
|
||||||
|
|
||||||
### Refactor
|
|
||||||
|
|
||||||
- Refactor configuration structs directly into the provider definition to simplify validation, structs, and future extensions
|
|
||||||
- Made the creation of the log directories a bit more fault tolerant
|
|
||||||
- Renamed the provider field in a config file to type to make things a little easier to understand; also removed husky
|
|
||||||
|
|||||||
Generated
+1
-1
@@ -1576,7 +1576,7 @@ checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gman"
|
name = "gman"
|
||||||
version = "0.1.0"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"argon2",
|
"argon2",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "gman"
|
name = "gman"
|
||||||
version = "0.1.0"
|
version = "0.0.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
authors = ["Alex Clarke <alex.j.tusa@gmail.com>"]
|
authors = ["Alex Clarke <alex.j.tusa@gmail.com>"]
|
||||||
description = "Universal secret management and injection tool"
|
description = "Universal secret management and injection tool"
|
||||||
|
|||||||
Reference in New Issue
Block a user