ci: maybe automate updating homebrew tap
refs: https://github.com/wez/wezterm/issues/208
This commit is contained in:
1 parent
52aa395bea
commit
cb5aed126c
4 files changed
+68
No files matched your search
@@ -88,3 +88,20 @@ jobs:
|
||||
files: "WezTerm-*.zip"
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
- name: "Checkout homebrew tap"
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: "wez/homebrew-wezterm"
|
||||
path: "homebrew-wezterm"
|
||||
- name: "Update homebrew tap formula"
|
||||
shell: bash
|
||||
run: |
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.9
|
||||
cp wezterm.rb $GITHUB_WORKSPACE/Formula/wezterm.rb
|
||||
|
||||
|
||||
- name: "Commit homebrew tap changes"
|
||||
uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: "Automated update to match latest tag"
|
||||
repository: "$GITHUB_WORKSPACE/homebrew-wezterm"
|
||||
@@ -30,6 +30,11 @@ case $OSTYPE in
|
||||
cp $TARGET_DIR/release/strip-ansi-escapes $zipdir/WezTerm.app
|
||||
cp -r assets/colors $zipdir/WezTerm.app/Contents/Resources/
|
||||
zip -r $zipname $zipdir
|
||||
|
||||
SHA256=$(shasum -a 256 $zipname | cut -d' ' -f1)
|
||||
sed -e "s/@TAG@/$TAG_NAME/" -e "s/@SHA256@/$SHA256/" < ci/wezterm-homebrew-macos.rb.template > wezterm.rb
|
||||
cat wezterm.rb
|
||||
|
||||
;;
|
||||
msys)
|
||||
zipdir=WezTerm-windows-$TAG_NAME
|
||||
|
||||
@@ -339,6 +339,34 @@ cargo build --all --release""",
|
||||
)
|
||||
]
|
||||
|
||||
def update_homebrew_tap(self):
|
||||
steps = []
|
||||
if "macos" in self.name:
|
||||
steps += [
|
||||
ActionStep(
|
||||
"Checkout homebrew tap",
|
||||
action="actions/checkout@v2",
|
||||
params={
|
||||
"repository": "wez/homebrew-wezterm",
|
||||
"path": "homebrew-wezterm",
|
||||
},
|
||||
),
|
||||
RunStep(
|
||||
"Update homebrew tap formula",
|
||||
"cp wezterm.rb $GITHUB_WORKSPACE/Formula/wezterm.rb",
|
||||
),
|
||||
ActionStep(
|
||||
"Commit homebrew tap changes",
|
||||
action="stefanzweifel/git-auto-commit-action@v4",
|
||||
params={
|
||||
"commit_message": "Automated update to match latest tag",
|
||||
"repository": "$GITHUB_WORKSPACE/homebrew-wezterm",
|
||||
},
|
||||
),
|
||||
]
|
||||
|
||||
return steps
|
||||
|
||||
def update_tagged_aur(self):
|
||||
steps = []
|
||||
|
||||
@@ -436,6 +464,7 @@ cargo build --all --release""",
|
||||
steps += self.package()
|
||||
steps += self.upload_asset_tag()
|
||||
steps += self.update_tagged_aur()
|
||||
steps += self.update_homebrew_tap()
|
||||
|
||||
env = self.global_env()
|
||||
return Job(runs_on=self.os, container=self.container, steps=steps, env=env,)
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
# Note: if you are viewing this from the tap repo, this file is automatically
|
||||
# updated from:
|
||||
# https://github.com/wez/wezterm/blob/master/ci/wezterm-homebrew-macos.rb.template
|
||||
# by automation in the wezterm repo.
|
||||
|
||||
class Wezterm < Formula
|
||||
desc "A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust"
|
||||
homepage "https://wezfurlong.org/wezterm/"
|
||||
url "https://github.com/wez/wezterm/releases/download/@TAG@/WezTerm-macos-@TAG@.zip"
|
||||
sha256 "@SHA256@"
|
||||
|
||||
def install
|
||||
prefix.install "WezTerm.app"
|
||||
bin.write_exec_script "#{prefix}/WezTerm.app/wezterm"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user