This commit is contained in:
@@ -7,6 +7,7 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- 'packaging/AUR/PKGBUILD.git'
|
- 'packaging/AUR/PKGBUILD.git'
|
||||||
- 'packaging/AUR/.SRCINFO.git'
|
- 'packaging/AUR/.SRCINFO.git'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish-aur-git:
|
publish-aur-git:
|
||||||
|
|||||||
68
.gitea/workflows/publish-homebrew.yml
Normal file
68
.gitea/workflows/publish-homebrew.yml
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
name: Publish Homebrew Tap
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish-homebrew:
|
||||||
|
runs-on: local
|
||||||
|
needs: []
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Wait for release asset
|
||||||
|
run: |
|
||||||
|
TAG="${GITHUB_REF#refs/tags/}"
|
||||||
|
VERSION="${TAG#v}"
|
||||||
|
ASSET_URL="https://github.com/n0va-bot/kewt/releases/download/${TAG}/kewt"
|
||||||
|
|
||||||
|
# Wait for the GitHub release asset to be available
|
||||||
|
for i in $(seq 1 12); do
|
||||||
|
if curl -sLf -o /dev/null "$ASSET_URL" 2>/dev/null; then
|
||||||
|
echo "Asset available at $ASSET_URL"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo "Waiting for release asset... (attempt $i)"
|
||||||
|
sleep 10
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Render Formula
|
||||||
|
run: |
|
||||||
|
TAG="${GITHUB_REF#refs/tags/}"
|
||||||
|
VERSION="${TAG#v}"
|
||||||
|
ASSET_URL="https://github.com/n0va-bot/kewt/releases/download/${TAG}/kewt"
|
||||||
|
|
||||||
|
curl -sL -o kewt-binary "$ASSET_URL"
|
||||||
|
CHECKSUM=$(sha256sum kewt-binary | awk '{print $1}')
|
||||||
|
rm -f kewt-binary
|
||||||
|
|
||||||
|
mkdir -p brew-work/Formula
|
||||||
|
sed -e "s/VERSION_PLACEHOLDER/${VERSION}/g" \
|
||||||
|
-e "s/SHA256SUM_PLACEHOLDER/${CHECKSUM}/g" \
|
||||||
|
packaging/homebrew/kewt.rb.template > brew-work/Formula/kewt.rb
|
||||||
|
|
||||||
|
echo "Generated Formula:"
|
||||||
|
cat brew-work/Formula/kewt.rb
|
||||||
|
|
||||||
|
- name: Push to GitHub homebrew-tap
|
||||||
|
run: |
|
||||||
|
TAG="${GITHUB_REF#refs/tags/}"
|
||||||
|
cd brew-work
|
||||||
|
|
||||||
|
git init
|
||||||
|
git remote add origin https://x-access-token:${{ secrets.GH_RELEASE_TOKEN }}@github.com/n0va-bot/homebrew-tap.git
|
||||||
|
git fetch origin main || git checkout --orphan main
|
||||||
|
git checkout main 2>/dev/null || git checkout --orphan main
|
||||||
|
|
||||||
|
# Overwrite with the rendered Formula
|
||||||
|
mkdir -p Formula
|
||||||
|
cp Formula/kewt.rb Formula/kewt.rb
|
||||||
|
|
||||||
|
git add Formula/kewt.rb
|
||||||
|
git config user.name "${{ github.actor }}"
|
||||||
|
git config user.email "${{ github.actor }}@users.noreply.github.com"
|
||||||
|
git commit -m "Update kewt to ${TAG}" || echo "No changes to commit"
|
||||||
|
git push origin main
|
||||||
@@ -3,6 +3,7 @@ name: Release Standalone Builder
|
|||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|||||||
16
packaging/homebrew/kewt.rb.template
Normal file
16
packaging/homebrew/kewt.rb.template
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
class Kewt < Formula
|
||||||
|
desc "Minimalist static site generator inspired by werc"
|
||||||
|
homepage "https://kewt.krzak.org"
|
||||||
|
url "https://github.com/n0va-bot/kewt/releases/download/VERSION_PLACEHOLDER/kewt"
|
||||||
|
sha256 "SHA256SUM_PLACEHOLDER"
|
||||||
|
license "ISC"
|
||||||
|
version "VERSION_PLACEHOLDER"
|
||||||
|
|
||||||
|
def install
|
||||||
|
bin.install "kewt"
|
||||||
|
end
|
||||||
|
|
||||||
|
test do
|
||||||
|
system "#{bin}/kewt", "--version"
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user