From 39c6c57bf39094405230c1a9a14b9c29ee1ede09 Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Wed, 7 Jul 2021 02:15:22 +0200 Subject: [PATCH 1/7] Add github CI and builder scripts (dockcross) Add github CI and builder scripts (dockcross) Signed-off-by: Bensuperpc --- .github/dependabot.yml | 9 +++++++++ .github/workflows/expired.yml | 22 ++++++++++++++++++++++ .github/workflows/main.yml | 30 ++++++++++++++++++++++++++++++ .gitignore | 2 ++ builder/cmake.sh | 6 ++++++ builder/cmake_all.sh | 11 +++++++++++ builder/functions/cmake_fn.sh | 19 +++++++++++++++++++ builder/functions/makefile_fn.sh | 15 +++++++++++++++ builder/makefile.sh | 6 ++++++ builder/makefile_all.sh | 11 +++++++++++ 10 files changed, 131 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/expired.yml create mode 100644 .github/workflows/main.yml create mode 100755 builder/cmake.sh create mode 100755 builder/cmake_all.sh create mode 100755 builder/functions/cmake_fn.sh create mode 100755 builder/functions/makefile_fn.sh create mode 100755 builder/makefile.sh create mode 100755 builder/makefile_all.sh diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..fe89e52 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +# Set update schedule for GitHub Actions + +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every weekday + interval: "daily" diff --git a/.github/workflows/expired.yml b/.github/workflows/expired.yml new file mode 100644 index 0000000..358b906 --- /dev/null +++ b/.github/workflows/expired.yml @@ -0,0 +1,22 @@ +name: 'Close stale issues and PRs' +on: + schedule: + - cron: '0 */8 * * *' +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + exempt-issue-milestones: 'future,alpha,beta,release' + exempt-pr-milestones: 'bugfix,improvement' + exempt-all-pr-assignees: true + stale-issue-message: 'This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 15 days.' + stale-pr-message: 'This PR is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 15 days.' + close-issue-message: 'This issue was closed because it has been stalled for 30 days with no activity.' + close-pr-message: 'This PR was closed because it has been stalled for 30 days with no activity.' + days-before-issue-stale: 120 + days-before-pr-stale: 120 + days-before-issue-close: 30 + days-before-pr-close: 30 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..d6bd199 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,30 @@ +name: tmux-mem-cpu-load + +on: + push: + branches: + - '*' + paths-ignore: + - '**/README.md' + pull_request: + branches: + - '*' + workflow_dispatch: + +jobs: + image: + name: build ${{ matrix.arch_name }} ${{ matrix.build_type }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + arch_name: [android-arm, android-arm64, android-x86, android-x86_64, web-wasm, linux-arm64, linux-arm64-musl, linux-armv5, linux-armv5-musl, linux-armv6, linux-armv6-musl, linux-armv7, linux-armv7a, linux-armv7l-musl, linux-x64-clang, linux-s390x, linux-x64, linux-x86, linux-mips, linux-ppc64le, manylinux1-x64, manylinux1-x86, manylinux2010-x64, manylinux2010-x86, manylinux2014-x64, manylinux2014-x86, manylinux2014-aarch64, windows-static-x64, windows-static-x64-posix, windows-static-x86, windows-shared-x64, windows-shared-x64-posix, windows-shared-x86, linux-riscv64, linux-riscv32] + build_type: [Release, Debug] + steps: + - name: "📥 Checkout Code" + uses: actions/checkout@v2 + with: + submodules: 'recursive' + fetch-depth: 0 + - name: "🛠️ build" + run: ./builder/cmake.sh ${{ matrix.arch_name }}:latest -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} diff --git a/.gitignore b/.gitignore index caf1808..ac32e0a 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,5 @@ Thumbs.db *.swp *.swo *~ +dockcross-* +build-* diff --git a/builder/cmake.sh b/builder/cmake.sh new file mode 100755 index 0000000..fa55f9b --- /dev/null +++ b/builder/cmake.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -euo pipefail + +source $(dirname "$0")/functions/cmake_fn.sh + +cmake_build $@ diff --git a/builder/cmake_all.sh b/builder/cmake_all.sh new file mode 100755 index 0000000..f53e822 --- /dev/null +++ b/builder/cmake_all.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -euo pipefail + +curl https://raw.githubusercontent.com/dockcross/dockcross/master/Makefile -o dockcross-Makefile +make -f dockcross-Makefile display_images + +source $(dirname "$0")/functions/cmake_fn.sh + +for image in $(make -f dockcross-Makefile display_images); do + cmake_build $image $@ +done diff --git a/builder/functions/cmake_fn.sh b/builder/functions/cmake_fn.sh new file mode 100755 index 0000000..031eeb3 --- /dev/null +++ b/builder/functions/cmake_fn.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -euo pipefail + +cmake_build () { + local image=$1 + local build_file=build-${image%:*} + shift 1 + local cmake_arg=$@ + echo "cmake arg: $cmake_arg" + + echo "Pulling dockcross/$image" + docker pull dockcross/$image + echo "Make script dockcross-$image" + docker run --rm dockcross/$image > ./dockcross-$image + chmod +x ./dockcross-$image + echo "Build $build_file" + ./dockcross-$image cmake -B$build_file -H. -GNinja $cmake_arg + ./dockcross-$image ninja -C$build_file +} diff --git a/builder/functions/makefile_fn.sh b/builder/functions/makefile_fn.sh new file mode 100755 index 0000000..69c0676 --- /dev/null +++ b/builder/functions/makefile_fn.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -euo pipefail + +makefile_build () { + local image=$1 + shift 1 + + echo "Pulling dockcross/$image" + docker pull dockcross/$image + echo "Make script dockcross-$image" + docker run --rm dockcross/$image > ./dockcross-$image + chmod +x ./dockcross-$image + echo "Build..." + ./dockcross-$image bash -c 'make CXX=$CXX CC=$CC AR=$AR AS=$AS CPP=$CPP FC=$FC' +} diff --git a/builder/makefile.sh b/builder/makefile.sh new file mode 100755 index 0000000..f61687c --- /dev/null +++ b/builder/makefile.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -euo pipefail + +source $(dirname "$0")/functions/makefile_fn.sh + +makefile_build $@ diff --git a/builder/makefile_all.sh b/builder/makefile_all.sh new file mode 100755 index 0000000..8b76d7a --- /dev/null +++ b/builder/makefile_all.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -euo pipefail + +curl https://raw.githubusercontent.com/dockcross/dockcross/master/Makefile -o dockcross-Makefile +make -f dockcross-Makefile display_images + +source $(dirname "$0")/functions/makefile_fn.sh + +for image in $(make -f dockcross-Makefile display_images); do + makefile_build $image $@ +done From db4edaeecc37c35e8571f1117958d1d10fe8ef08 Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Wed, 7 Jul 2021 02:30:01 +0200 Subject: [PATCH 2/7] Remove unsupported system Remove unsupported system Signed-off-by: Bensuperpc --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d6bd199..ef7b5a1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,9 @@ jobs: strategy: fail-fast: false matrix: - arch_name: [android-arm, android-arm64, android-x86, android-x86_64, web-wasm, linux-arm64, linux-arm64-musl, linux-armv5, linux-armv5-musl, linux-armv6, linux-armv6-musl, linux-armv7, linux-armv7a, linux-armv7l-musl, linux-x64-clang, linux-s390x, linux-x64, linux-x86, linux-mips, linux-ppc64le, manylinux1-x64, manylinux1-x86, manylinux2010-x64, manylinux2010-x86, manylinux2014-x64, manylinux2014-x86, manylinux2014-aarch64, windows-static-x64, windows-static-x64-posix, windows-static-x86, windows-shared-x64, windows-shared-x64-posix, windows-shared-x86, linux-riscv64, linux-riscv32] + # Disable: unsupported system: android-arm, android-arm64, android-x86, android-x86_64, + # Disable: missing header in linux(GCC): windows-static-x64, windows-static-x64-posix, windows-static-x86, windows-shared-x64, windows-shared-x64-posix, windows-shared-x86, + arch_name: [web-wasm, linux-arm64, linux-arm64-musl, linux-armv5, linux-armv5-musl, linux-armv6, linux-armv6-musl, linux-armv7, linux-armv7a, linux-armv7l-musl, linux-x64-clang, linux-s390x, linux-x64, linux-x86, linux-mips, linux-ppc64le, manylinux1-x64, manylinux1-x86, manylinux2010-x64, manylinux2010-x86, manylinux2014-x64, manylinux2014-x86, manylinux2014-aarch64, linux-riscv64, linux-riscv32] build_type: [Release, Debug] steps: - name: "📥 Checkout Code" From e652a93b72a187b46fd45e418e570eea7c49230d Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Wed, 7 Jul 2021 02:36:25 +0200 Subject: [PATCH 3/7] Add contributor in README Add contributor in README Signed-off-by: Bensuperpc --- .github/workflows/main.yml | 1 + README.rst | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ef7b5a1..15461e2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,6 +6,7 @@ on: - '*' paths-ignore: - '**/README.md' + - '**/README.rst' pull_request: branches: - '*' diff --git a/README.rst b/README.rst index 3c0483b..b0cc39b 100644 --- a/README.rst +++ b/README.rst @@ -174,7 +174,7 @@ Contributions from: * Compilenix * jodavies * `@nhdaly`_ (Nathan Daly) - +* bensuperpc .. _tmux: http://tmux.sourceforge.net/ .. _CMake: http://www.cmake.org From bf41ae4393db19ebbe1faa10e2e1ca9f44909c0d Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Wed, 7 Jul 2021 02:38:25 +0200 Subject: [PATCH 4/7] Remove Emscripten Remove Emscripten Signed-off-by: Bensuperpc --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 15461e2..02d809b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,9 +19,9 @@ jobs: strategy: fail-fast: false matrix: - # Disable: unsupported system: android-arm, android-arm64, android-x86, android-x86_64, + # Disable: unsupported system: android-arm, android-arm64, android-x86, android-x86_64, web-wasm, # Disable: missing header in linux(GCC): windows-static-x64, windows-static-x64-posix, windows-static-x86, windows-shared-x64, windows-shared-x64-posix, windows-shared-x86, - arch_name: [web-wasm, linux-arm64, linux-arm64-musl, linux-armv5, linux-armv5-musl, linux-armv6, linux-armv6-musl, linux-armv7, linux-armv7a, linux-armv7l-musl, linux-x64-clang, linux-s390x, linux-x64, linux-x86, linux-mips, linux-ppc64le, manylinux1-x64, manylinux1-x86, manylinux2010-x64, manylinux2010-x86, manylinux2014-x64, manylinux2014-x86, manylinux2014-aarch64, linux-riscv64, linux-riscv32] + arch_name: [linux-arm64, linux-arm64-musl, linux-armv5, linux-armv5-musl, linux-armv6, linux-armv6-musl, linux-armv7, linux-armv7a, linux-armv7l-musl, linux-x64-clang, linux-s390x, linux-x64, linux-x86, linux-mips, linux-ppc64le, manylinux1-x64, manylinux1-x86, manylinux2010-x64, manylinux2010-x86, manylinux2014-x64, manylinux2014-x86, manylinux2014-aarch64, linux-riscv64, linux-riscv32] build_type: [Release, Debug] steps: - name: "📥 Checkout Code" From 8c9c31798ccc31d2806f0187b186f42ea68a23ed Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Wed, 7 Jul 2021 02:46:40 +0200 Subject: [PATCH 5/7] Add Release workflow Add Release workflow Signed-off-by: Bensuperpc --- .github/release.yml | 62 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/release.yml diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..cb7f5bf --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,62 @@ +name: "tagged-release" + +on: + push: + tags: + - "v*" + workflow_dispatch: + +jobs: + build: + name: build ${{ matrix.arch_name }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # Disable: unsupported system: android-arm, android-arm64, android-x86, android-x86_64, web-wasm, + # Disable: missing header in linux(GCC): windows-static-x64, windows-static-x64-posix, windows-static-x86, windows-shared-x64, windows-shared-x64-posix, windows-shared-x86, + arch_name: [linux-arm64, linux-arm64-musl, linux-armv5, linux-armv5-musl, linux-armv6, linux-armv6-musl, linux-armv7, linux-armv7a, linux-armv7l-musl, linux-x64-clang, linux-s390x, linux-x64, linux-x86, linux-mips, linux-ppc64le, manylinux1-x64, manylinux1-x86, manylinux2010-x64, manylinux2010-x86, manylinux2014-x64, manylinux2014-x86, manylinux2014-aarch64, linux-riscv64, linux-riscv32] + steps: + - name: "📥 Checkout Code" + uses: actions/checkout@v2 + with: + submodules: 'recursive' + fetch-depth: 0 + - name: "🛠️ cmake" + run: ./builder/cmake.sh ${{ matrix.arch_name }}:latest -DCMAKE_BUILD_TYPE=Release + - name: "✅ checksum" + run: cd build-${{ matrix.arch_name }} && find . -maxdepth 1 -name "tmux-mem-cpu-load*" | xargs sha256sum > checksum.sha256 + - name: "🗜️ compress" + run: cd build-${{ matrix.arch_name }} && find . -maxdepth 1 -name "tmux-mem-cpu-load*" -o -name "*.sha256" | XZ_OPT=-e9 tar -cJf tmux-mem-cpu-load-${{ matrix.arch_name }}.tar.xz -T - && mv tmux-mem-cpu-load-${{ matrix.arch_name }}.tar.xz .. + - name: "💾 save binaries" + uses: actions/upload-artifact@v2 + with: + name: bin-artifact + path: tmux-mem-cpu-load-${{ matrix.arch_name }}.tar.xz + retention-days: 1 + release: + name: release + runs-on: ubuntu-latest + needs: build + steps: + - name: "📥 Checkout Code" + uses: actions/checkout@v2 + with: + submodules: 'recursive' + fetch-depth: 0 + - name: get artifact + uses: actions/download-artifact@v2 + with: + name: bin-artifact + path: . + - name: "✅ checksum" + run: find . -maxdepth 1 -name "*.tar.xz" | xargs sha256sum > checksum_all.sha256 + - uses: "marvinpinto/action-automatic-releases@latest" + name: "📤 upload to github" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + prerelease: false + files: | + LICENSE + *.tar.xz + *.sha256 \ No newline at end of file From acea452957e5d063c49669e1c3e3f0bfbfe9eb49 Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Wed, 7 Jul 2021 02:53:42 +0200 Subject: [PATCH 6/7] Fix workflow Fix Release workflow Signed-off-by: Bensuperpc --- .github/{ => workflows}/release.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/release.yml (100%) diff --git a/.github/release.yml b/.github/workflows/release.yml similarity index 100% rename from .github/release.yml rename to .github/workflows/release.yml From 3ec357c63cd8a4a1628a569d50ff2a71aa9c6b9c Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Wed, 7 Jul 2021 02:57:38 +0200 Subject: [PATCH 7/7] Improve release trigger Improve release trigger Signed-off-by: Bensuperpc --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cb7f5bf..e67fecd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: "tagged-release" on: push: tags: - - "v*" + - "v[0-9]+.[0-9]+.[0-9]+*" workflow_dispatch: jobs: