1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-26 08:25:50 +03:00

ci: add automation to update the wezterm-bin AUR at tag time

This is untested beyond eyeballing the locally generated file.
Will need to make a couple of tags to test this for sure.

refs: https://github.com/wez/wezterm/issues/209
This commit is contained in:
Wez Furlong 2020-06-07 12:19:41 -07:00
parent 76a1300c15
commit d755c270e4
5 changed files with 95 additions and 1 deletions

View File

@ -76,3 +76,12 @@ jobs:
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: "Update AUR"
uses: KSXGitHub/github-actions-deploy-aur@master
with:
pkgname: "wezterm-bin"
pkgbuild: "PKGBUILD"
commit_username: "wez"
commit_email: "wez@wezfurlong.org"
ssh_private_key: "${{ secrets.AUR_SSH_PRIVATE_KEY }}"
commit_message: "Automated update to match latest tag"

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
.DS_Store
/docs/_site
/PKGBUILD
/WezTerm*.zip
/WezTerm*.exe
/wezterm*.deb

58
ci/PKGBUILD.template Normal file
View File

@ -0,0 +1,58 @@
# Maintainer: Wez Furlong <wez at wezfurlong dot org>
# NOTE: if you're looking at this on AUR, this file is generated from
# https://github.com/wez/wezterm/blob/master/ci/PKGBUILD.template
# by automation in the wezterm repo.
pkgname=wezterm-bin
_tag=@TAG@
pkgver=$(echo $_tag | tr - .)
pkgrel=2
pkgdesc='A GPU-accelerated cross-platform terminal emulator and multiplexer implemented in Rust'
arch=('i686' 'x86_64')
url='https://wezfurlong.org/wezterm'
license=('MIT')
provides=('wezterm')
# Don't strip: it will break the binary and it only saves ~10% anyway
options=('!strip')
makedepends=('fuse')
depends=(
'dbus'
'fontconfig'
'hicolor-icon-theme'
'libx11'
'libxkbcommon-x11'
'wayland'
'xcb-util-keysyms'
'xcb-util-wm'
)
source=(
"wezterm::https://github.com/wez/wezterm/releases/download/${_tag}/WezTerm-${_tag}-Ubuntu16.04.AppImage"
'LICENSE::https://github.com/wez/wezterm/raw/master/LICENSE.md'
)
sha256sums=(
'@SHA256@'
'191c46fcf52061382b1c51a70311eb9081381cc158e5899f3739473a9432185b'
)
prepare() {
chmod +x "${srcdir}/wezterm"
}
pkgver() {
"${srcdir}/wezterm" --version | cut -d' ' -f2 | tr - .
}
build() {
"${srcdir}/wezterm" --appimage-extract >/dev/null
}
package() {
install -Dm755 squashfs-root/usr/bin/wezterm -t "${pkgdir}/usr/bin/"
install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
install -Dm644 squashfs-root/usr/share/icons/hicolor/128x128/apps/org.wezfurlong.wezterm.png \
"${pkgdir}/usr/share/icons/hicolor/128x128/apps/org.wezfurlong.wezterm.png"
install -Dm644 squashfs-root/usr/share/applications/org.wezfurlong.wezterm.desktop \
"${pkgdir}/usr/share/applications/org.wezfurlong.wezterm.desktop"
install -dm755 ${pkgdir}/usr/share/wezterm/colors
install -Dm644 -t ${pkgdir}/usr/share/wezterm/colors/* squashfs-root/usr/share/wezterm/colors/*
}

View File

@ -37,4 +37,7 @@ OUTPUT="$OUTPUT" \
--output appimage \
--desktop-file assets/wezterm.desktop
# Update the AUR build file. We only really want to use this for tagged
# builds but it doesn't hurt to generate it always here.
SHA256=$(sha256sum $OUTPUT | cut -d' ' -f1)
sed -e "s/@TAG@/$TAG_NAME/" -e "s/@SHA256@/$SHA256/" < ci/PKGBUILD.template > PKGBUILD

View File

@ -335,6 +335,28 @@ cargo build --all --release""",
)
]
def update_tagged_aur(self):
steps = []
if self.app_image:
# The AppImage build step also expands the PKGBUILD template
steps += [
ActionStep(
"Update AUR",
action="KSXGitHub/github-actions-deploy-aur@master",
params={
"pkgname":"wezterm-bin",
"pkgbuild":"PKGBUILD",
"commit_username":"wez",
"commit_email":"wez@wezfurlong.org",
"ssh_private_key":"${{ secrets.AUR_SSH_PRIVATE_KEY }}",
"commit_message":"Automated update to match latest tag",
}
)
]
return steps
def global_env(self):
env = {}
if "macos" in self.name:
@ -413,6 +435,7 @@ cargo build --all --release""",
steps += self.test_all_release()
steps += self.package()
steps += self.upload_asset_tag()
steps += self.update_tagged_aur()
env = self.global_env()
return Job(runs_on=self.os, container=self.container, steps=steps, env=env,)