diff --git a/.github/workflows/gen_ubuntu20.04_tag.yml b/.github/workflows/gen_ubuntu20.04_tag.yml index b0d121857..66a0a82b2 100644 --- a/.github/workflows/gen_ubuntu20.04_tag.yml +++ b/.github/workflows/gen_ubuntu20.04_tag.yml @@ -125,3 +125,17 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash run: "bash ci/retry.sh gh release upload --clobber $(ci/tag-name.sh) wezterm-*.deb wezterm-*.xz *src.tar.gz *.AppImage *.zsync *.sha256" + - name: "Checkout flathub/org.wezfurlong.wezterm" + uses: actions/checkout@v3 + with: + repository: "flathub/org.wezfurlong.wezterm" + path: "flathub" + token: "${{ secrets.GH_PAT }}" + - name: "Create flathub commit and push" + shell: bash + run: "bash ci/make-flathub-pr.sh" + - name: "Submit PR" + env: + GITHUB_TOKEN: ${{ secrets.GH_PAT }} + shell: bash + run: 'cd flathub && gh pr create --fill --body "PR automatically created by release automation in the wezterm repo"' diff --git a/assets/flatpak/org.wezfurlong.wezterm.appdata.template.xml b/assets/flatpak/org.wezfurlong.wezterm.appdata.template.xml new file mode 100644 index 000000000..0a1a22273 --- /dev/null +++ b/assets/flatpak/org.wezfurlong.wezterm.appdata.template.xml @@ -0,0 +1,79 @@ + + + + org.wezfurlong.wezterm + MIT + MIT + Wez's Terminal Emulator + A GPU-accelerated cross-platform terminal emulator and multiplexer + +

+ WezTerm is a terminal emulator with support for modern features such as + fonts with ligatures, hyperlinks, multiple windows, tabs and split panes. +

+ +

+ Configuration is expressed using Lua and many powerful functions are + provided to help you customize your terminal to your workflow. +

+ +

+ Integrated ssh allows using multiple tabs and panes without requiring + tmux to be installed on the remote host, and remote wezterm multiplexer + support allows tmux+mosh style workflows without using tmux or mosh, + while providing a fully native GUI locally. +

+
+ + org.wezfurlong.wezterm.desktop + + https://wezfurlong.org/wezterm/ + https://wezfurlong.org/wezterm/help.html + https://github.com/wez/wezterm/issues + https://github.com/sponsors/wez + + + + Use background image attachments + https://wezfurlong.org/wezterm/screenshots/wezterm-vday-screenshot.png + + + Ligatures in VIM + https://wezfurlong.org/wezterm/screenshots/two.png + + + Multiple windows, tabs and panes are supported + + + + Quickselect makes mouseless selection fast and convenient + https://wezfurlong.org/wezterm/screenshots/wezterm-quick-select.png + + + Dynamically change color schemes via escape sequences + + + + Use gradients as background image attachments + https://wezfurlong.org/wezterm/screenshots/radial-gradient.png + + + Compose multiple background layers with parallax scrolling + + + + + Wez Furlong + + + + +

+ A very long list of improvements to performance and + resource utilization as well as new features. + The changelog has a complete list! +

+
+
+
+
diff --git a/assets/flatpak/org.wezfurlong.wezterm.template.json b/assets/flatpak/org.wezfurlong.wezterm.template.json new file mode 100644 index 000000000..c515c45c6 --- /dev/null +++ b/assets/flatpak/org.wezfurlong.wezterm.template.json @@ -0,0 +1,60 @@ +{ + "app-id": "org.wezfurlong.wezterm", + "runtime": "org.freedesktop.Platform", + "runtime-version": "21.08", + "sdk": "org.freedesktop.Sdk", + "sdk-extensions" : [ + "org.freedesktop.Sdk.Extension.rust-stable" + ], + "command": "wezterm", + "finish-args": [ + "--share=ipc", + "--filesystem=home:ro", + "--filesystem=xdg-config/wezterm", + "--socket=fallback-x11", + "--socket=wayland", + "--device=dri", + "--talk-name=org.freedesktop.Flatpak", + "--talk-name=org.freedesktop.Notifications", + "--share=network" + ], + "modules": [ + { + "name": "wezterm", + "buildsystem": "simple", + "build-options": { + "append-path" : "/usr/lib/sdk/rust-stable/bin", + "env": { + "CARGO_HOME": "/run/build/wezterm/cargo" + } + }, + "build-commands": [ + "cargo --offline fetch --manifest-path Cargo.toml --verbose", + "cargo --offline build --release --verbose", + "install -Dm644 ./assets/icon/terminal.png /app/share/icons/hicolor/128x128/apps/org.wezfurlong.wezterm.png", + "install -Dm644 org.wezfurlong.wezterm.appdata.xml /app/share/metainfo/org.wezfurlong.wezterm.appdata.xml", + "install -Dm644 ./assets/wezterm.desktop /app/share/applications/org.wezfurlong.wezterm.desktop", + "install -Dm755 ./target/release/wezterm -t /app/bin/", + "install -Dm755 ./target/release/wezterm-gui -t /app/bin/", + "install -Dm755 ./target/release/wezterm-mux-server -t /app/bin/", + "install -Dm755 ./target/release/strip-ansi-escapes -t /app/bin/", + "install -Dm644 assets/shell-integration/* -t /app/extra/export/share/etc/profile.d", + "install -Dm644 assets/shell-completion/zsh /app/extra/export/share/zsh/site-functions/_wezterm", + "install -Dm644 assets/shell-completion/bash /app/extra/export/share/etc/bash_completion.d/wezterm" + ], + "sources": [ + { + "type": "archive", + "archive-type": "tar-gzip", + "url": "@URL@", + "sha256": "@SHA256@" + }, + { + "type": "file", + "path": "org.wezfurlong.wezterm.appdata.xml" + }, + "generated-sources.json" + ] + } + ] +} diff --git a/ci/flatpak.sh b/ci/flatpak.sh index b9c203a1a..6da403597 100755 --- a/ci/flatpak.sh +++ b/ci/flatpak.sh @@ -10,4 +10,11 @@ flatpak run --env=G_DEBUG=fatal-criticals org.freedesktop.appstream-glib validat python3 -m pip install toml aiohttp curl -L 'https://github.com/flatpak/flatpak-builder-tools/raw/master/cargo/flatpak-cargo-generator.py' > /tmp/flatpak-cargo-generator.py python3 /tmp/flatpak-cargo-generator.py Cargo.lock -o assets/flatpak/generated-sources.json -flatpak-builder --state-dir /var/tmp/wezterm-flatpak-builder --install /var/tmp/wezterm-flatpak-repo assets/flatpak/org.wezfurlong.wezterm.json --force-clean --user -y + +if [ "${CI}" != "yes" ] ; then + flatpak-builder \ + --state-dir /var/tmp/wezterm-flatpak-builder \ + --install /var/tmp/wezterm-flatpak-repo \ + assets/flatpak/org.wezfurlong.wezterm.json \ + --force-clean --user -y +fi diff --git a/ci/generate-workflows.py b/ci/generate-workflows.py index 92b146225..19c8ec5cc 100755 --- a/ci/generate-workflows.py +++ b/ci/generate-workflows.py @@ -149,7 +149,7 @@ class InstallCrateStep(ActionStep): super().__init__( f"Install {crate} from Cargo", action="baptiste0928/cargo-install@v2", - params=params + params=params, ) @@ -451,7 +451,6 @@ cargo build --all --release""", run=run, ), ] - def package(self, trusted=False): steps = [] @@ -639,6 +638,32 @@ cargo build --all --release""", ), ] + def create_flathub_pr(self): + if not self.app_image: + return [] + return [ + ActionStep( + "Checkout flathub/org.wezfurlong.wezterm", + action="actions/checkout@v3", + params={ + "repository": "flathub/org.wezfurlong.wezterm", + "path": "flathub", + "token": "${{ secrets.GH_PAT }}", + }, + ), + RunStep( + "Create flathub commit and push", + "bash ci/make-flathub-pr.sh", + ), + RunStep( + "Submit PR", + 'cd flathub && gh pr create --fill --body "PR automatically created by release automation in the wezterm repo"', + env={ + "GITHUB_TOKEN": "${{ secrets.GH_PAT }}", + }, + ), + ] + def create_winget_pr(self): steps = [] if "windows" in self.name: @@ -885,7 +910,8 @@ cargo build --all --release""", runs_on="ubuntu-latest", steps=self.checkout(submodules=False) + self.upload_asset_tag() - + self.create_winget_pr(), + + self.create_winget_pr() + + self.create_flathub_pr(), ) return ( diff --git a/ci/make-flathub-pr.sh b/ci/make-flathub-pr.sh new file mode 100755 index 000000000..d582bad8c --- /dev/null +++ b/ci/make-flathub-pr.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -xe +TAG_NAME=$(ci/tag-name.sh) + +python3 -m pip install toml aiohttp +curl -L 'https://github.com/flatpak/flatpak-builder-tools/raw/master/cargo/flatpak-cargo-generator.py' > /tmp/flatpak-cargo-generator.py +python3 /tmp/flatpak-cargo-generator.py Cargo.lock -o flathub/generated-sources.json + +URL="https://github.com/wez/wezterm/releases/download/${TAG_NAME}/wezterm-${TAG_NAME}-src.tar.gz" + +# We require that something has obtained the source archive already and left it +# in the current dir. This is handled by actions/download-artifact in CI +SHA256=$(sha256sum wezterm*-src.tar.gz | cut -d' ' -f1) + +sed -e "s,@URL@,$URL,g" -e "s/@SHA256@/$SHA256/g" < assets/flatpak/org.wezfurlong.wezterm.template.json > flathub/org.wezfurlong.wezterm.json + +RELEASE_DATE=$(git -c "core.abbrev=8" show -s "--format=%cd" "--date=format:%Y-%m-%d") +sed -e "s,@TAG_NAME@,$TAG_NAME,g" -e "s/@DATE@/$RELEASE_DATE/g" < assets/flatpak/org.wezfurlong.wezterm.appdata.template.xml > flathub/org.wezfurlong.wezterm.appdata.xml + +cd flathub +git config user.email wez@wezfurlong.org +git config user.name 'Wez Furlong' +git checkout -b "$TAG_NAME" origin/master +git add --all +git diff --cached +git commit -m "New version: $TAG_NAME" +git push --set-upstream origin "$TAG_NAME" --quiet