ci: Manually created first winget package: ready for full release (hopefully)

This commit is contained in:
2025-09-16 10:55:59 -06:00
parent d3ca5d52bc
commit 2a01189a07
3 changed files with 103 additions and 212 deletions
+100 -209
View File
@@ -390,117 +390,8 @@ jobs:
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'
# shell: bash
# 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"
#
# echo "PackageIdentifier: $IDENTIFIER" >> "$root/$IDENTIFIER.yaml"
# echo "PackageVersion: $RELEASE_VERSION" >> "$root/$IDENTIFIER.yaml"
# echo "DefaultLocale: en-US" >> "$root/$IDENTIFIER.yaml"
# echo "ManifestType: version" >> "$root/$IDENTIFIER.yaml"
# echo "ManifestVersion: 1.10.0" >> "$root/$IDENTIFIER.yaml"
#
# echo "PackageIdentifier: $IDENTIFIER" >> "$root/$IDENTIFIER.locale.en-US.yaml"
# echo "PackageVersion: $RELEASE_VERSION" >> "$root/$IDENTIFIER.locale.en-US.yaml"
# echo "PackageLocale: en-US" >> "$root/$IDENTIFIER.locale.en-US.yaml"
# echo "Publisher: $publisher" >> "$root/$IDENTIFIER.locale.en-US.yaml"
# echo "PackageName: $pkgname" >> "$root/$IDENTIFIER.locale.en-US.yaml"
# echo "PublisherUrl: https://github.com/$REPO" >> "$root/$IDENTIFIER.locale.en-US.yaml"
# echo "PublisherSupportUrl: https://github.com/$REPO/issues" >> "$root/$IDENTIFIER.locale.en-US.yaml"
# echo "Author: Dark-Alex-17" >> "$root/$IDENTIFIER.locale.en-US.yaml"
# echo "Moniker: gman" >> "$root/$IDENTIFIER.locale.en-US.yaml"
# echo "License: $license" >> "$root/$IDENTIFIER.locale.en-US.yaml"
# echo "LicenseUrl: https://github.com/$REPO/blob/main/LICENSE" >> "$root/$IDENTIFIER.locale.en-US.yaml"
# echo "ShortDescription: $desc" >> "$root/$IDENTIFIER.locale.en-US.yaml"
# echo "ManifestType: defaultLocale" >> "$root/$IDENTIFIER.locale.en-US.yaml"
# echo "ManifestVersion: 1.10.0" >> "$root/$IDENTIFIER.locale.en-US.yaml"
#
# echo "PackageIdentifier: $IDENTIFIER" >> "$root/$IDENTIFIER.installer.yaml"
# echo "PackageVersion: $RELEASE_VERSION" >> "$root/$IDENTIFIER.installer.yaml"
# echo "InstallerType: zip" >> "$root/$IDENTIFIER.installer.yaml"
# echo "Installers:" >> "$root/$IDENTIFIER.installer.yaml"
# echo " - Architecture: x64" >> "$root/$IDENTIFIER.installer.yaml"
# echo " InstallerUrl: $url_x64" >> "$root/$IDENTIFIER.installer.yaml"
# echo " InstallerSha256: $x64_sha" >> "$root/$IDENTIFIER.installer.yaml"
# echo " NestedInstallerType: portable" >> "$root/$IDENTIFIER.installer.yaml"
# echo " NestedInstallerFiles:" >> "$root/$IDENTIFIER.installer.yaml"
# echo " - RelativeFilePath: gman.exe" >> "$root/$IDENTIFIER.installer.yaml"
# echo " PortableCommandAlias: gman" >> "$root/$IDENTIFIER.installer.yaml"
# echo " - Architecture: arm64" >> "$root/$IDENTIFIER.installer.yaml"
# echo " InstallerUrl: $url_arm64" >> "$root/$IDENTIFIER.installer.yaml"
# echo " InstallerSha256: $arm64_sha" >> "$root/$IDENTIFIER.installer.yaml"
# echo " NestedInstallerType: portable" >> "$root/$IDENTIFIER.installer.yaml"
# echo " NestedInstallerFiles:" >> "$root/$IDENTIFIER.installer.yaml"
# echo " - RelativeFilePath: gman.exe" >> "$root/$IDENTIFIER.installer.yaml"
# echo " PortableCommandAlias: gman" >> "$root/$IDENTIFIER.installer.yaml"
# echo "ManifestType: installer" >> "$root/$IDENTIFIER.installer.yaml"
# echo "ManifestVersion: 1.10.0" >> "$root/$IDENTIFIER.installer.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: |
# winget install wingetcreate
#
# - name: Submit initial package to winget-pkgs
# if: steps.check.outputs.exists == 'false' && env.ACT != 'true'
# shell: bash
# 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: env.ACT != 'true'
# if: steps.check.outputs.exists == 'true' && env.ACT != 'true'
uses: vedantmgoyal9/winget-releaser@v2 uses: vedantmgoyal9/winget-releaser@v2
with: with:
identifier: DarkAlex17.GMan identifier: DarkAlex17.GMan
@@ -509,103 +400,103 @@ jobs:
installers-regex: '\.zip$' installers-regex: '\.zip$'
token: ${{ secrets.WINGET_GITHUB_TOKEN }} token: ${{ secrets.WINGET_GITHUB_TOKEN }}
# publish-homebrew-formula: publish-homebrew-formula:
# needs: [publish-github-release] needs: [publish-github-release]
# name: Update Homebrew formulas name: Update Homebrew formulas
# runs-on: ubuntu-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' }}
# 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 - name: Checkout repository
# uses: actions/checkout@v4 uses: actions/checkout@v4
# with: with:
# fetch-depth: 1 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 assets and version
# shell: bash shell: bash
# run: | run: |
# # Set environment variables # Set environment variables
# macos_sha="$(cat ./artifacts/gman-x86_64-apple-darwin.sha256 | awk '{print $1}')" macos_sha="$(cat ./artifacts/gman-x86_64-apple-darwin.sha256 | awk '{print $1}')"
# echo "MACOS_SHA=$macos_sha" >> $GITHUB_ENV echo "MACOS_SHA=$macos_sha" >> $GITHUB_ENV
# macos_sha_arm="$(cat ./artifacts/gman-aarch64-apple-darwin.sha256 | awk '{print $1}')" macos_sha_arm="$(cat ./artifacts/gman-aarch64-apple-darwin.sha256 | awk '{print $1}')"
# echo "MACOS_SHA_ARM=$macos_sha_arm" >> $GITHUB_ENV echo "MACOS_SHA_ARM=$macos_sha_arm" >> $GITHUB_ENV
# linux_sha="$(cat ./artifacts/gman-x86_64-unknown-linux-musl.sha256 | awk '{print $1}')" linux_sha="$(cat ./artifacts/gman-x86_64-unknown-linux-musl.sha256 | awk '{print $1}')"
# echo "LINUX_SHA=$linux_sha" >> $GITHUB_ENV echo "LINUX_SHA=$linux_sha" >> $GITHUB_ENV
# release_version="$(cat ./artifacts/release-version)" release_version="$(cat ./artifacts/release-version)"
# echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
#
# - name: Validate release environment variables - name: Validate release environment variables
# run: | run: |
# echo "Release SHA macos: ${{ env.MACOS_SHA }}" echo "Release SHA macos: ${{ env.MACOS_SHA }}"
# echo "Release SHA macos-arm: ${{ env.MACOS_SHA_ARM }}" echo "Release SHA macos-arm: ${{ env.MACOS_SHA_ARM }}"
# echo "Release SHA linux musl: ${{ env.LINUX_SHA }}" echo "Release SHA linux musl: ${{ env.LINUX_SHA }}"
# echo "Release version: ${{ env.RELEASE_VERSION }}" echo "Release version: ${{ env.RELEASE_VERSION }}"
#
# - name: Execute Homebrew packaging script - name: Execute Homebrew packaging script
# if: env.ACT != 'true' if: env.ACT != 'true'
# run: | run: |
# # run packaging script # run packaging script
# python "./deployment/homebrew/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/homebrew/gman.rb.template" "./gman.rb" ${{ env.MACOS_SHA }} ${{ env.MACOS_SHA_ARM }} ${{ env.LINUX_SHA }} python "./deployment/homebrew/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/homebrew/gman.rb.template" "./gman.rb" ${{ env.MACOS_SHA }} ${{ env.MACOS_SHA_ARM }} ${{ env.LINUX_SHA }}
#
# - name: Push changes to Homebrew tap - name: Push changes to Homebrew tap
# if: env.ACT != 'true' if: env.ACT != 'true'
# env: env:
# TOKEN: ${{ secrets.GMAN_GITHUB_TOKEN }} TOKEN: ${{ secrets.GMAN_GITHUB_TOKEN }}
# run: | run: |
# # push to Git # push to Git
# git config --global user.name "Dark-Alex-17" git config --global user.name "Dark-Alex-17"
# git config --global user.email "alex.j.tusa@gmail.com" git config --global user.email "alex.j.tusa@gmail.com"
# git clone https://Dark-Alex-17:${{ secrets.GMAN_GITHUB_TOKEN }}@github.com/Dark-Alex-17/homebrew-gman.git git clone https://Dark-Alex-17:${{ secrets.GMAN_GITHUB_TOKEN }}@github.com/Dark-Alex-17/homebrew-gman.git
# rm homebrew-gman/Formula/gman.rb rm homebrew-gman/Formula/gman.rb
# cp gman.rb homebrew-gman/Formula cp gman.rb homebrew-gman/Formula
# cd homebrew-gman cd homebrew-gman
# git add . git add .
# git diff-index --quiet HEAD || git commit -am "Update formula for G-Man release ${{ env.RELEASE_VERSION }}" git diff-index --quiet HEAD || git commit -am "Update formula for G-Man release ${{ env.RELEASE_VERSION }}"
# git push https://$TOKEN@github.com/Dark-Alex-17/homebrew-gman.git git push https://$TOKEN@github.com/Dark-Alex-17/homebrew-gman.git
#
# publish-crate: publish-crate:
# needs: publish-github-release needs: publish-github-release
# name: Publish Crate name: Publish Crate
# runs-on: ubuntu-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' }}
# 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 - name: Checkout
# uses: actions/checkout@v4 uses: actions/checkout@v4
# with: with:
# fetch-depth: 0 fetch-depth: 0
#
# - name: Get bumped Cargo files (Act) - name: Get bumped Cargo files (Act)
# if: env.ACT == 'true' if: env.ACT == 'true'
# uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
# with: with:
# name: bumped-cargo-files name: bumped-cargo-files
# path: ${{ github.workspace }} path: ${{ github.workspace }}
#
# - name: Ensure repository is up-to-date - name: Ensure repository is up-to-date
# if: env.ACT != 'true' if: env.ACT != 'true'
# run: | run: |
# git fetch --all git fetch --all
# git pull git pull
#
# - name: Install Rust stable - name: Install Rust stable
# uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
#
# - uses: katyo/publish-crates@v2 - uses: katyo/publish-crates@v2
# if: env.ACT != 'true' if: env.ACT != 'true'
# with: with:
# registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
+2 -2
View File
@@ -3,8 +3,8 @@ name = "gman"
version = "0.0.2" version = "0.0.2"
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 command line secret management and injection tool"
keywords = ["cli", "secrets", "credentials", "command-line", "encryption"] keywords = ["cli", "secrets-manager", "secret-injection", "command-runner", "vault"]
documentation = "https://github.com/Dark-Alex-17/gman" documentation = "https://github.com/Dark-Alex-17/gman"
repository = "https://github.com/Dark-Alex-17/gman" repository = "https://github.com/Dark-Alex-17/gman"
homepage = "https://github.com/Dark-Alex-17/gman" homepage = "https://github.com/Dark-Alex-17/gman"
+1 -1
View File
@@ -1,4 +1,4 @@
# G-Man - Universal CLI Credential Manager and Injection Tool # G-Man - Universal Command Line Secret Manager and Injection Tool
![Check](https://github.com/Dark-Alex-17/gman/actions/workflows/check.yml/badge.svg) ![Check](https://github.com/Dark-Alex-17/gman/actions/workflows/check.yml/badge.svg)
![Test](https://github.com/Dark-Alex-17/gman/actions/workflows/test.yml/badge.svg) ![Test](https://github.com/Dark-Alex-17/gman/actions/workflows/test.yml/badge.svg)