mirror of
https://github.com/bartvdbraak/homebrew-keyweave.git
synced 2025-04-27 17:41:22 +00:00
feat: add musl option and template release
This commit is contained in:
parent
a54829b41f
commit
c91781ba92
2 changed files with 87 additions and 5 deletions
76
.github/workflows/release.yml
vendored
76
.github/workflows/release.yml
vendored
|
@ -8,10 +8,80 @@ on:
|
||||||
sha256sums:
|
sha256sums:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
CI_COMMIT_MESSAGE: 'feat: added formula for v${{ inputs.version }}'
|
||||||
|
CI_COMMIT_AUTHOR: github-actions[bot]
|
||||||
steps:
|
steps:
|
||||||
- run: 'echo ${{ inputs.version }}'
|
- uses: actions/checkout@v4
|
||||||
- run: |
|
- name: Generate Homebrew Formula
|
||||||
echo ${{ fromJson(inputs.sha256sums)['keyweave-x86_64-unknown-linux-musl.tar.xz'] }}
|
id: generate-formula
|
||||||
|
run: |
|
||||||
|
# Create a temporary formula file
|
||||||
|
TMP_FORMULA="$(mktemp)"
|
||||||
|
|
||||||
|
# Define the formula content with GitHub expressions
|
||||||
|
cat <<EOF > "${TMP_FORMULA}"
|
||||||
|
class Keyweave < Formula
|
||||||
|
desc "Fetches secrets from Azure Key Vault and weaves them into a convenient .env file"
|
||||||
|
homepage "https://github.com/bartvdbraak/keyweave"
|
||||||
|
license "GPLv3"
|
||||||
|
version "${{ inputs.version }}"
|
||||||
|
|
||||||
|
option "with-gnu-libc", "Install glibc binary"
|
||||||
|
option "with-musl-libc", "Install musl binary (default)"
|
||||||
|
|
||||||
|
if OS.mac?
|
||||||
|
if Hardware::CPU.arm?
|
||||||
|
url "https://github.com/bartvdbraak/keyweave/releases/download/v${{ inputs.version }}/keyweave-aarch64-apple-darwin.tar.xz"
|
||||||
|
sha256 "${{ fromJson(inputs.sha256sums)['keyweave-aarch64-apple-darwin.tar.xz'] }}"
|
||||||
|
else
|
||||||
|
url "https://github.com/bartvdbraak/keyweave/releases/download/v${{ inputs.version }}/keyweave-x86_64-apple-darwin.tar.xz"
|
||||||
|
sha256 "${{ fromJson(inputs.sha256sums)['keyweave-x86_64-apple-darwin.tar.xz'] }}"
|
||||||
|
end
|
||||||
|
elif OS.linux?
|
||||||
|
if Hardware::CPU.arm?
|
||||||
|
if Hardware::CPU.is_32_bit?
|
||||||
|
url "https://github.com/bartvdbraak/keyweave/releases/download/v${{ inputs.version }}/keyweave-armv7-unknown-linux-gnueabihf.tar.xz"
|
||||||
|
sha256 "${{ fromJson(inputs.sha256sums)['keyweave-armv7-unknown-linux-gnueabihf.tar.xz'] }}"
|
||||||
|
else
|
||||||
|
url "https://github.com/bartvdbraak/keyweave/releases/download/v${{ inputs.version }}/keyweave-aarch64-unknown-linux-gnu.tar.xz"
|
||||||
|
sha256 "${{ fromJson(inputs.sha256sums)['keyweave-aarch64-unknown-linux-gnu.tar.xz'] }}"
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if build.with?("with-gnu-libc")
|
||||||
|
url "https://github.com/bartvdbraak/keyweave/releases/download/v${{ inputs.version }}/keyweave-x86_64-unknown-linux-gnu.tar.xz"
|
||||||
|
sha256 "${{ fromJson(inputs.sha256sums)['keyweave-x86_64-unknown-linux-gnu.tar.xz'] }}"
|
||||||
|
elsif build.with?("with-musl-libc")
|
||||||
|
url "https://github.com/bartvdbraak/keyweave/releases/download/v${{ inputs.version }}/keyweave-x86_64-unknown-linux-musl.tar.xz"
|
||||||
|
sha256 "${{ fromJson(inputs.sha256sums)['keyweave-x86_64-unknown-linux-musl.tar.xz'] }}"
|
||||||
|
else
|
||||||
|
url "https://github.com/bartvdbraak/keyweave/releases/download/v${{ inputs.version }}/keyweave-x86_64-unknown-linux-musl.tar.xz"
|
||||||
|
sha256 "${{ fromJson(inputs.sha256sums)['keyweave-x86_64-unknown-linux-musl.tar.xz'] }}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def install
|
||||||
|
bin.install "keyweave"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Append the generated formula to the target file
|
||||||
|
cat "${TMP_FORMULA}" > "Formula/keyweave.rb"
|
||||||
|
|
||||||
|
# Clean up the temporary formula file
|
||||||
|
rm "${TMP_FORMULA}"
|
||||||
|
|
||||||
|
- name: Commit Homebrew Formula
|
||||||
|
run: |
|
||||||
|
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
|
||||||
|
git config --global user.email "bartvdbraak@users.noreply.github.com"
|
||||||
|
git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}"
|
||||||
|
git push
|
|
@ -1,8 +1,12 @@
|
||||||
class Keyweave < Formula
|
class Keyweave < Formula
|
||||||
desc "Fetches secrets from Azure Key Vault and weaves them into a convenient .env file"
|
desc "Fetches secrets from Azure Key Vault and weaves them into a convenient .env file"
|
||||||
homepage "https://github.com/bartvdbraak/keyweave"
|
homepage "https://github.com/bartvdbraak/keyweave"
|
||||||
|
license "GPLv3"
|
||||||
version "0.2.0"
|
version "0.2.0"
|
||||||
|
|
||||||
|
option "with-gnu-libc", "Install glibc binary"
|
||||||
|
option "with-musl-libc", "Install musl binary (default)"
|
||||||
|
|
||||||
if OS.mac?
|
if OS.mac?
|
||||||
if Hardware::CPU.arm?
|
if Hardware::CPU.arm?
|
||||||
url "https://github.com/bartvdbraak/keyweave/releases/download/v0.2.0/keyweave-aarch64-apple-darwin.tar.xz"
|
url "https://github.com/bartvdbraak/keyweave/releases/download/v0.2.0/keyweave-aarch64-apple-darwin.tar.xz"
|
||||||
|
@ -21,8 +25,16 @@ class Keyweave < Formula
|
||||||
sha256 "da415340276b6bc8f700e54cafdef23445973dba0d126065cf73135dff2c922d"
|
sha256 "da415340276b6bc8f700e54cafdef23445973dba0d126065cf73135dff2c922d"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
url "https://github.com/bartvdbraak/keyweave/releases/download/v0.2.0/keyweave-x86_64-unknown-linux-musl.tar.xz"
|
if build.with?("with-gnu-libc")
|
||||||
sha256 "6f6ad0810a4bf75d914dd09c4c55efadc8b038d10811c4223b787ac5d1cf4186"
|
url "https://github.com/bartvdbraak/keyweave/releases/download/v0.2.0/keyweave-x86_64-unknown-linux-gnu.tar.xz"
|
||||||
|
sha256 "79317c194bd41a2d9ec55e80353e3eb510a11e3c57708e65cc0a34966a86ae14"
|
||||||
|
elsif build.with?("with-musl-libc")
|
||||||
|
url "https://github.com/bartvdbraak/keyweave/releases/download/v0.2.0/keyweave-x86_64-unknown-linux-musl.tar.xz"
|
||||||
|
sha256 "6f6ad0810a4bf75d914dd09c4c55efadc8b038d10811c4223b787ac5d1cf4186"
|
||||||
|
else
|
||||||
|
url "https://github.com/bartvdbraak/keyweave/releases/download/v0.2.0/keyweave-x86_64-unknown-linux-musl.tar.xz"
|
||||||
|
sha256 "6f6ad0810a4bf75d914dd09c4c55efadc8b038d10811c4223b787ac5d1cf4186"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue