Skip to content

Commit e2b3eb4

Browse files
authored
Update DEPLOY workflow (#172)
Adds a leeway pkg+ to build packages only and upload them as GHA artifacts. Backwards compatibility with zstd >= 1.1.2 to fix the build failure in Debian 9. (Previously we depended on zstd >= 1.3.0) Use rustup to install the latest Rust stable version available in Ubuntu, Debian and Fedora distributions. Add Fedora 33
1 parent 360208e commit e2b3eb4

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ on:
88
jobs:
99

1010
build:
11-
if: contains(github.event.head_commit.message, 'deploy+')
11+
if: contains(github.event.head_commit.message, 'deploy+') || contains(github.event.head_commit.message, 'pkg+')
1212
strategy:
1313
matrix:
14-
container: [ "ubuntu:18.04", "ubuntu:19.10", "ubuntu:20.04", "debian:9", "debian:10", "fedora:29", "fedora:30", "fedora:31", "fedora:32", "archlinux:latest" ]
14+
container: [ "ubuntu:18.04", "ubuntu:19.10", "ubuntu:20.04", "debian:9", "debian:10", "fedora:29", "fedora:30", "fedora:31", "fedora:32", "fedora:33", "archlinux:latest" ]
1515
# this list should be updated from time to time by consulting these pages:
1616
# https://releases.ubuntu.com/
1717
# https://wiki.debian.org/DebianReleases#Production_Releases
@@ -37,6 +37,7 @@ jobs:
3737
path: artifact
3838

3939
deploy:
40+
if: contains(github.event.head_commit.message, 'deploy+')
4041
needs: build
4142
runs-on: "ubuntu-latest"
4243
container:

src/frontend/LayoutViewer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ void LayoutViewer::on_viewAltGr_clicked() {
104104

105105
QByteArray LayoutViewer::decodeAndDecompress(QByteArray &data) {
106106
std::string decoded = base91::decode(std::string(data.data(), data.size()));
107-
unsigned long long cap = ZSTD_getFrameContentSize(decoded.data(), decoded.size());
107+
// Use ZSTD_getFrameContentSize() function when we can hard depend on zstd 1.3.0
108+
unsigned long long cap = ZSTD_getDecompressedSize(decoded.data(), decoded.size());
108109
char *imgData = (char *)malloc(cap);
109110

110111
size_t decompressed = ZSTD_decompress(imgData, cap, decoded.data(), decoded.size());

tools/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
Builds OpenBangla Keyboard packages for various distributions.
44

55
- A lightweight C/I workflow runs by default on each commit.
6-
- if commit message has the string `deploy+`, then a deploy workflow runs instead of the default one.
7-
- if build passes, this workflow will deploy packages to repositories, and create a github release.
6+
- if commit message has the string `pkg+` or `deploy+`, then a deploy workflow runs instead of the default one.
7+
- if build passes & `pkg+` is present, this workflow will upload the packages as Github Actions artifacts.
8+
- if build passes & `deploy+` is present, this workflow will deploy packages to repositories, and create a github release.

tools/build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ RELEASE_STUB="OpenBangla-Keyboard_${RELEASE_VERSION}-"
55

66
makeDeb () {
77
RELEASE_FILENAME="${RELEASE_STUB}${DIST}.deb"
8-
apt-get -y install build-essential cmake libibus-1.0-dev libzstd-dev qt5-default rustc cargo ninja-build curl
8+
apt-get -y install build-essential cmake libibus-1.0-dev libzstd-dev qt5-default ninja-build curl
9+
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable
910
cmake -H"$GITHUB_WORKSPACE" -B/build -GNinja -DCPACK_GENERATOR=DEB
1011
ninja package -C /build
1112
RELEASE_FILE="/build/${RELEASE_FILENAME}"
1213
}
1314

1415
makeRpm () {
1516
RELEASE_FILENAME="${RELEASE_STUB}${DIST}.rpm"
16-
dnf install -y --allowerasing @buildsys-build cmake ibus-devel libzstd-devel qt5-qtdeclarative-devel rust cargo ninja-build
17+
dnf install -y --allowerasing @buildsys-build cmake ibus-devel libzstd-devel qt5-qtdeclarative-devel ninja-build curl
18+
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable
1719
cmake -H"$GITHUB_WORKSPACE" -B/build -GNinja -DCPACK_GENERATOR=RPM
1820
ninja package -C /build
1921
RELEASE_FILE="/build/${RELEASE_FILENAME}"

0 commit comments

Comments
 (0)