1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-22 04:41:34 +03:00

Add opensuse packages to build/release workflows (#1916)

* added opensuse packaging

* change deploy.sh rpm spec for opensuse

* added missing opensuse openssh install logic

* push generated workflows

* fix typo in func name - yum vs zypper

* Update ci/generate-workflows.py

merge run steps

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>

* fix libxcb-* packages for opensuse

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
xpufx 2022-04-25 23:27:56 +03:00 committed by GitHub
parent f309f81274
commit 9f6d2db154
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 663 additions and 6 deletions

89
.github/workflows/gen_opensuse_leap.yml vendored Normal file
View File

@ -0,0 +1,89 @@
name: opensuse_leap
on:
pull_request:
branches:
- main
paths-ignore:
- ".cirrus.yml"
- "docs/*"
- "ci/build-docs.sh"
- "ci/generate-docs.py"
- "ci/subst-release-info.py"
- ".github/workflows/pages.yml"
- ".github/workflows/verify-pages.yml"
- ".github/workflows/no-response.yml"
- ".github/ISSUE_TEMPLATE/*"
- "**/*.md"
jobs:
build:
runs-on: "ubuntu-latest"
container: "registry.opensuse.org/opensuse/leap:15.3"
steps:
- name: "Seed GITHUB_PATH to work around possible @action/core bug"
shell: bash
run: 'echo "$PATH:/bin:/usr/bin" >> $GITHUB_PATH'
- name: "Install lsb-release"
shell: bash
run: "zypper install -y lsb-release"
- name: "Install util-linux"
shell: bash
run: "zypper install -y util-linux"
- name: "Install git"
shell: bash
run: "zypper install -y git"
- name: "Install curl"
shell: bash
run: "zypper install -y curl"
- name: "Ensure /run/sshd exists"
shell: bash
run: "mkdir -p /run/sshd"
- name: "Install openssh-server"
shell: bash
run: "zypper install -y openssh-server"
- name: "Workaround git permissions issue"
shell: bash
run: "git config --global --add safe.directory /__w/wezterm/wezterm"
- name: "checkout repo"
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
- name: "Cache cargo"
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: "opensuse_leap-None-2-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-cargo"
- name: "Install System Deps"
shell: bash
run: "env PATH=$PATH ./get-deps"
- name: "Build (Release mode)"
shell: bash
run: "cargo build --all --release"
- name: "Test (Release mode)"
shell: bash
run: "cargo test --all --release"
- name: "Package"
shell: bash
run: "bash ci/deploy.sh"
- name: "Move RPM"
shell: bash
run: "mv /usr/src/packages/RPMS/*/*.rpm ."
- name: "Upload artifact"
uses: actions/upload-artifact@v3
with:
name: "opensuse_leap"
path: "wezterm-*.rpm"

View File

@ -0,0 +1,114 @@
name: opensuse_leap_continuous
on:
schedule:
- cron: "10 3 * * *"
push:
branches:
- main
paths-ignore:
- ".cirrus.yml"
- "docs/**"
- "ci/build-docs.sh"
- "ci/generate-docs.py"
- "ci/subst-release-info.py"
- ".github/workflows/pages.yml"
- ".github/workflows/verify-pages.yml"
- ".github/workflows/no-response.yml"
- ".github/ISSUE_TEMPLATE/*"
- "**/*.md"
jobs:
build:
runs-on: "ubuntu-latest"
container: "registry.opensuse.org/opensuse/leap:15.3"
env:
BUILD_REASON: "Schedule"
steps:
- name: "Seed GITHUB_PATH to work around possible @action/core bug"
shell: bash
run: 'echo "$PATH:/bin:/usr/bin" >> $GITHUB_PATH'
- name: "Install lsb-release"
shell: bash
run: "zypper install -y lsb-release"
- name: "Install util-linux"
shell: bash
run: "zypper install -y util-linux"
- name: "Install git"
shell: bash
run: "zypper install -y git"
- name: "Install curl"
shell: bash
run: "zypper install -y curl"
- name: "Ensure /run/sshd exists"
shell: bash
run: "mkdir -p /run/sshd"
- name: "Install openssh-server"
shell: bash
run: "zypper install -y openssh-server"
- name: "Workaround git permissions issue"
shell: bash
run: "git config --global --add safe.directory /__w/wezterm/wezterm"
- name: "checkout repo"
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
- name: "Cache cargo"
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: "opensuse_leap-None-2-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-cargo"
- name: "Install System Deps"
shell: bash
run: "env PATH=$PATH ./get-deps"
- name: "Build (Release mode)"
shell: bash
run: "cargo build --all --release"
- name: "Test (Release mode)"
shell: bash
run: "cargo test --all --release"
- name: "Package"
shell: bash
run: "bash ci/deploy.sh"
- name: "Move RPM"
shell: bash
run: "mv /usr/src/packages/RPMS/*/*.rpm wezterm-nightly-opensuse_leap.rpm"
- name: "Upload artifact"
uses: actions/upload-artifact@v3
with:
name: "opensuse_leap"
path: "wezterm-*.rpm"
retention-days: 5
upload:
runs-on: ubuntu-latest
needs: build
steps:
- name: "Workaround git permissions issue"
shell: bash
run: "git config --global --add safe.directory /__w/wezterm/wezterm"
- name: "checkout repo"
uses: actions/checkout@v3
- name: "Download artifact"
uses: actions/download-artifact@v3
with:
name: "opensuse_leap"
- name: "Upload to Nightly Release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: "bash ci/retry.sh gh release upload --clobber nightly wezterm-*.rpm"

View File

@ -0,0 +1,105 @@
name: opensuse_leap_tag
on:
push:
tags:
- "20*"
jobs:
build:
runs-on: "ubuntu-latest"
container: "registry.opensuse.org/opensuse/leap:15.3"
env:
BUILD_REASON: "Schedule"
steps:
- name: "Seed GITHUB_PATH to work around possible @action/core bug"
shell: bash
run: 'echo "$PATH:/bin:/usr/bin" >> $GITHUB_PATH'
- name: "Install lsb-release"
shell: bash
run: "zypper install -y lsb-release"
- name: "Install util-linux"
shell: bash
run: "zypper install -y util-linux"
- name: "Install git"
shell: bash
run: "zypper install -y git"
- name: "Install curl"
shell: bash
run: "zypper install -y curl"
- name: "Ensure /run/sshd exists"
shell: bash
run: "mkdir -p /run/sshd"
- name: "Install openssh-server"
shell: bash
run: "zypper install -y openssh-server"
- name: "Workaround git permissions issue"
shell: bash
run: "git config --global --add safe.directory /__w/wezterm/wezterm"
- name: "checkout repo"
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
- name: "Cache cargo"
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: "opensuse_leap-None-2-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-cargo"
- name: "Install System Deps"
shell: bash
run: "env PATH=$PATH ./get-deps"
- name: "Build (Release mode)"
shell: bash
run: "cargo build --all --release"
- name: "Test (Release mode)"
shell: bash
run: "cargo test --all --release"
- name: "Package"
shell: bash
run: "bash ci/deploy.sh"
- name: "Move RPM"
shell: bash
run: "mv /usr/src/packages/RPMS/*/*.rpm ."
- name: "Upload artifact"
uses: actions/upload-artifact@v3
with:
name: "opensuse_leap"
path: "wezterm-*.rpm"
upload:
runs-on: ubuntu-latest
needs: build
steps:
- name: "Workaround git permissions issue"
shell: bash
run: "git config --global --add safe.directory /__w/wezterm/wezterm"
- name: "checkout repo"
uses: actions/checkout@v3
- name: "Download artifact"
uses: actions/download-artifact@v3
with:
name: "opensuse_leap"
- name: "Create pre-release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: "bash ci/retry.sh bash ci/create-release.sh $(ci/tag-name.sh)"
- name: "Upload to Tagged Release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: "bash ci/retry.sh gh release upload --clobber $(ci/tag-name.sh) wezterm-*.rpm"

View File

@ -0,0 +1,89 @@
name: opensuse_tumbleweed
on:
pull_request:
branches:
- main
paths-ignore:
- ".cirrus.yml"
- "docs/*"
- "ci/build-docs.sh"
- "ci/generate-docs.py"
- "ci/subst-release-info.py"
- ".github/workflows/pages.yml"
- ".github/workflows/verify-pages.yml"
- ".github/workflows/no-response.yml"
- ".github/ISSUE_TEMPLATE/*"
- "**/*.md"
jobs:
build:
runs-on: "ubuntu-latest"
container: "registry.opensuse.org/opensuse/tumbleweed"
steps:
- name: "Seed GITHUB_PATH to work around possible @action/core bug"
shell: bash
run: 'echo "$PATH:/bin:/usr/bin" >> $GITHUB_PATH'
- name: "Install lsb-release"
shell: bash
run: "zypper install -y lsb-release"
- name: "Install util-linux"
shell: bash
run: "zypper install -y util-linux"
- name: "Install git"
shell: bash
run: "zypper install -y git"
- name: "Install curl"
shell: bash
run: "zypper install -y curl"
- name: "Ensure /run/sshd exists"
shell: bash
run: "mkdir -p /run/sshd"
- name: "Install openssh-server"
shell: bash
run: "zypper install -y openssh-server"
- name: "Workaround git permissions issue"
shell: bash
run: "git config --global --add safe.directory /__w/wezterm/wezterm"
- name: "checkout repo"
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
- name: "Cache cargo"
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: "opensuse_tumbleweed-None-2-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-cargo"
- name: "Install System Deps"
shell: bash
run: "env PATH=$PATH ./get-deps"
- name: "Build (Release mode)"
shell: bash
run: "cargo build --all --release"
- name: "Test (Release mode)"
shell: bash
run: "cargo test --all --release"
- name: "Package"
shell: bash
run: "bash ci/deploy.sh"
- name: "Move RPM"
shell: bash
run: "mv /usr/src/packages/RPMS/*/*.rpm ."
- name: "Upload artifact"
uses: actions/upload-artifact@v3
with:
name: "opensuse_tumbleweed"
path: "wezterm-*.rpm"

View File

@ -0,0 +1,114 @@
name: opensuse_tumbleweed_continuous
on:
schedule:
- cron: "10 3 * * *"
push:
branches:
- main
paths-ignore:
- ".cirrus.yml"
- "docs/**"
- "ci/build-docs.sh"
- "ci/generate-docs.py"
- "ci/subst-release-info.py"
- ".github/workflows/pages.yml"
- ".github/workflows/verify-pages.yml"
- ".github/workflows/no-response.yml"
- ".github/ISSUE_TEMPLATE/*"
- "**/*.md"
jobs:
build:
runs-on: "ubuntu-latest"
container: "registry.opensuse.org/opensuse/tumbleweed"
env:
BUILD_REASON: "Schedule"
steps:
- name: "Seed GITHUB_PATH to work around possible @action/core bug"
shell: bash
run: 'echo "$PATH:/bin:/usr/bin" >> $GITHUB_PATH'
- name: "Install lsb-release"
shell: bash
run: "zypper install -y lsb-release"
- name: "Install util-linux"
shell: bash
run: "zypper install -y util-linux"
- name: "Install git"
shell: bash
run: "zypper install -y git"
- name: "Install curl"
shell: bash
run: "zypper install -y curl"
- name: "Ensure /run/sshd exists"
shell: bash
run: "mkdir -p /run/sshd"
- name: "Install openssh-server"
shell: bash
run: "zypper install -y openssh-server"
- name: "Workaround git permissions issue"
shell: bash
run: "git config --global --add safe.directory /__w/wezterm/wezterm"
- name: "checkout repo"
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
- name: "Cache cargo"
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: "opensuse_tumbleweed-None-2-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-cargo"
- name: "Install System Deps"
shell: bash
run: "env PATH=$PATH ./get-deps"
- name: "Build (Release mode)"
shell: bash
run: "cargo build --all --release"
- name: "Test (Release mode)"
shell: bash
run: "cargo test --all --release"
- name: "Package"
shell: bash
run: "bash ci/deploy.sh"
- name: "Move RPM"
shell: bash
run: "mv /usr/src/packages/RPMS/*/*.rpm wezterm-nightly-opensuse_tumbleweed.rpm"
- name: "Upload artifact"
uses: actions/upload-artifact@v3
with:
name: "opensuse_tumbleweed"
path: "wezterm-*.rpm"
retention-days: 5
upload:
runs-on: ubuntu-latest
needs: build
steps:
- name: "Workaround git permissions issue"
shell: bash
run: "git config --global --add safe.directory /__w/wezterm/wezterm"
- name: "checkout repo"
uses: actions/checkout@v3
- name: "Download artifact"
uses: actions/download-artifact@v3
with:
name: "opensuse_tumbleweed"
- name: "Upload to Nightly Release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: "bash ci/retry.sh gh release upload --clobber nightly wezterm-*.rpm"

View File

@ -0,0 +1,105 @@
name: opensuse_tumbleweed_tag
on:
push:
tags:
- "20*"
jobs:
build:
runs-on: "ubuntu-latest"
container: "registry.opensuse.org/opensuse/tumbleweed"
env:
BUILD_REASON: "Schedule"
steps:
- name: "Seed GITHUB_PATH to work around possible @action/core bug"
shell: bash
run: 'echo "$PATH:/bin:/usr/bin" >> $GITHUB_PATH'
- name: "Install lsb-release"
shell: bash
run: "zypper install -y lsb-release"
- name: "Install util-linux"
shell: bash
run: "zypper install -y util-linux"
- name: "Install git"
shell: bash
run: "zypper install -y git"
- name: "Install curl"
shell: bash
run: "zypper install -y curl"
- name: "Ensure /run/sshd exists"
shell: bash
run: "mkdir -p /run/sshd"
- name: "Install openssh-server"
shell: bash
run: "zypper install -y openssh-server"
- name: "Workaround git permissions issue"
shell: bash
run: "git config --global --add safe.directory /__w/wezterm/wezterm"
- name: "checkout repo"
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: "Install Rust"
uses: actions-rs/toolchain@v1
with:
profile: "minimal"
toolchain: "stable"
override: true
components: "rustfmt"
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
- name: "Cache cargo"
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: "opensuse_tumbleweed-None-2-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-cargo"
- name: "Install System Deps"
shell: bash
run: "env PATH=$PATH ./get-deps"
- name: "Build (Release mode)"
shell: bash
run: "cargo build --all --release"
- name: "Test (Release mode)"
shell: bash
run: "cargo test --all --release"
- name: "Package"
shell: bash
run: "bash ci/deploy.sh"
- name: "Move RPM"
shell: bash
run: "mv /usr/src/packages/RPMS/*/*.rpm ."
- name: "Upload artifact"
uses: actions/upload-artifact@v3
with:
name: "opensuse_tumbleweed"
path: "wezterm-*.rpm"
upload:
runs-on: ubuntu-latest
needs: build
steps:
- name: "Workaround git permissions issue"
shell: bash
run: "git config --global --add safe.directory /__w/wezterm/wezterm"
- name: "checkout repo"
uses: actions/checkout@v3
- name: "Download artifact"
uses: actions/download-artifact@v3
with:
name: "opensuse_tumbleweed"
- name: "Create pre-release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: "bash ci/retry.sh bash ci/create-release.sh $(ci/tag-name.sh)"
- name: "Upload to Tagged Release"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: "bash ci/retry.sh gh release upload --clobber $(ci/tag-name.sh) wezterm-*.rpm"

View File

@ -124,11 +124,11 @@ case $OSTYPE in
7z a -tzip $zipname $zipdir
iscc.exe -DMyAppVersion=${TAG_NAME#nightly} -F${instname} ci/windows-installer.iss
;;
linux-gnu)
linux-gnu|linux)
distro=$(lsb_release -is 2>/dev/null || sh -c "source /etc/os-release && echo \$NAME")
distver=$(lsb_release -rs 2>/dev/null || sh -c "source /etc/os-release && echo \$VERSION_ID")
case "$distro" in
*Fedora*|*CentOS*)
*Fedora*|*CentOS*|*SUSE*)
WEZTERM_RPM_VERSION=$(echo ${TAG_NAME#nightly-} | tr - _)
cat > wezterm.spec <<EOF
Name: wezterm
@ -138,7 +138,11 @@ Packager: Wez Furlong <wez@wezfurlong.org>
License: MIT
URL: https://wezfurlong.org/wezterm/
Summary: Wez's Terminal Emulator.
%if 0%{?suse_version}
Requires: dbus-1, fontconfig, openssl, libxcb1, libxkbcommon0, libxkbcommon-x11-0, libwayland-client0, libwayland-egl1, libwayland-cursor0, Mesa-libEGL1, libxcb-keysyms1, libxcb-ewmh2, libxcb-icccm4
%else
Requires: dbus, fontconfig, openssl, libxcb, libxkbcommon, libxkbcommon-x11, libwayland-client, libwayland-egl, libwayland-cursor, mesa-libEGL, xcb-util-keysyms, xcb-util-wm
%endif
%description
wezterm is a terminal emulator with support for modern features

View File

@ -158,6 +158,11 @@ class Target(object):
if "alpine" in self.name:
return True
return False
def uses_zypper(self):
if "suse" in self.name:
return True
return False
def needs_sudo(self):
if not self.container and self.uses_apt():
@ -172,6 +177,8 @@ class Target(object):
installer = "apt-get"
elif self.uses_apk():
installer = "apk"
elif self.uses_zypper():
installer = "zypper"
else:
return []
if self.needs_sudo():
@ -182,7 +189,7 @@ class Target(object):
return [RunStep(f"Install {name}", f"{installer} install -y {name}")]
def install_curl(self):
if self.uses_yum() or self.uses_apk() or (self.uses_apt() and self.container):
if self.uses_yum() or self.uses_apk() or self.uses_zypper() or (self.uses_apt() and self.container):
if "centos:stream9" in self.container:
return self.install_system_package("curl-minimal")
else:
@ -191,7 +198,7 @@ class Target(object):
def install_openssh_server(self):
steps = []
if self.uses_yum() or (self.uses_apt() and self.container):
if self.uses_yum() or self.uses_zypper() or (self.uses_apt() and self.container):
steps += [
RunStep("Ensure /run/sshd exists", "mkdir -p /run/sshd")
] + self.install_system_package("openssh-server")
@ -233,6 +240,8 @@ class Target(object):
pre_reqs = "yum install -y wget curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker make"
elif self.uses_apt():
pre_reqs = "apt-get install -y wget libcurl4-openssl-dev libexpat-dev gettext libssl-dev libz-dev gcc libextutils-autoinstall-perl make"
elif self.uses_zypper():
pre_reqs = "zypper install -y wget libcurl-devel libexpat-devel gettext-tools libopenssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker make"
steps.append(
RunStep(
@ -395,6 +404,13 @@ cargo build --all --release""",
f"mv ~/.abuild/*.pub wezterm-{self.name}.pub",
)
]
elif self.uses_zypper():
steps.append(
RunStep(
"Move RPM",
f"mv /usr/src/packages/RPMS/*/*.rpm .",
)
)
patterns = self.asset_patterns()
glob = " ".join(patterns)
@ -410,7 +426,7 @@ cargo build --all --release""",
def asset_patterns(self):
patterns = []
if self.uses_yum():
if self.uses_yum() or self.uses_zypper():
patterns += ["wezterm-*.rpm"]
elif "win" in self.name:
patterns += ["WezTerm-*.zip", "WezTerm-*.exe"]
@ -446,6 +462,13 @@ cargo build --all --release""",
f"mv ~/packages/wezterm/x86_64/*.apk wezterm-nightly-{self.name}.apk",
)
)
elif self.uses_zypper():
steps.append(
RunStep(
"Move RPM",
f"mv /usr/src/packages/RPMS/*/*.rpm wezterm-nightly-{self.name}.rpm",
)
)
patterns = self.asset_patterns()
glob = " ".join(patterns)
@ -581,6 +604,18 @@ cargo build --all --release""",
RunStep("Update APT", f"{sudo}apt update"),
]
if self.uses_zypper():
if self.container:
steps += [
RunStep(
"Seed GITHUB_PATH to work around possible @action/core bug",
f"echo \"$PATH:/bin:/usr/bin\" >> $GITHUB_PATH"
),
RunStep(
"Install lsb-release & util-linux",
"zypper install -y lsb-release util-linux"
),
]
if self.container:
if ("fedora" in self.container) or ("centos" in self.container):
steps += [
@ -735,6 +770,8 @@ TARGETS = [
Target(container="alpine:3.13"),
Target(container="alpine:3.14"),
Target(container="alpine:3.15"),
Target(name="opensuse_leap", container="registry.opensuse.org/opensuse/leap:15.3"),
Target(name="opensuse_tumbleweed", container="registry.opensuse.org/opensuse/tumbleweed"),
Target(name="windows", os="windows-latest", rust_target="x86_64-pc-windows-msvc"),
]

View File

@ -106,7 +106,7 @@ suse_deps() {
'gcc' \
'gcc-c++' \
'fontconfig-devel' \
'openssl-devel' \
'libopenssl-devel' \
'perl' \
'python3' \
'libxcb-devel' \