From be1b54ba3377d3759bab1c003b192cfba3ca630c Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 6 Dec 2021 09:45:14 -0700 Subject: [PATCH] ci: try installing GH inside containers `gh` is pre-installed in native runners only; when we build in a container, we need to install it for ourselves. This commit drops support for building on centos7 as it is a PITA to get this working there. --- .github/workflows/gen_centos7.yml | 105 -------------- .github/workflows/gen_centos7_continuous.yml | 129 ------------------ .github/workflows/gen_centos7_tag.yml | 96 ------------- .github/workflows/gen_centos8.yml | 6 + .github/workflows/gen_centos8_continuous.yml | 10 ++ .github/workflows/gen_centos8_tag.yml | 6 + .github/workflows/gen_debian10.3.yml | 9 ++ .../workflows/gen_debian10.3_continuous.yml | 15 ++ .github/workflows/gen_debian10.3_tag.yml | 9 ++ .github/workflows/gen_debian11.yml | 9 ++ .github/workflows/gen_debian11_continuous.yml | 15 ++ .github/workflows/gen_debian11_tag.yml | 9 ++ .github/workflows/gen_debian9.12.yml | 9 ++ .../workflows/gen_debian9.12_continuous.yml | 15 ++ .github/workflows/gen_debian9.12_tag.yml | 9 ++ .github/workflows/gen_fedora33.yml | 6 + .github/workflows/gen_fedora33_continuous.yml | 10 ++ .github/workflows/gen_fedora33_tag.yml | 6 + .github/workflows/gen_fedora34.yml | 6 + .github/workflows/gen_fedora34_continuous.yml | 10 ++ .github/workflows/gen_fedora34_tag.yml | 6 + .github/workflows/gen_fedora35.yml | 6 + .github/workflows/gen_fedora35_continuous.yml | 10 ++ .github/workflows/gen_fedora35_tag.yml | 6 + .github/workflows/gen_ubuntu20.04.yml | 22 +-- .../workflows/gen_ubuntu20.04_continuous.yml | 30 +--- .github/workflows/gen_ubuntu20.04_tag.yml | 22 +-- ci/generate-workflows.py | 27 +++- 28 files changed, 226 insertions(+), 392 deletions(-) delete mode 100644 .github/workflows/gen_centos7.yml delete mode 100644 .github/workflows/gen_centos7_continuous.yml delete mode 100644 .github/workflows/gen_centos7_tag.yml diff --git a/.github/workflows/gen_centos7.yml b/.github/workflows/gen_centos7.yml deleted file mode 100644 index dc2173176..000000000 --- a/.github/workflows/gen_centos7.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: centos7 - -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/ISSUE_TEMPLATE/*" - - "**/*.md" - -jobs: - build: - runs-on: "ubuntu-latest" - container: "centos:7" - steps: - - name: "Install SCL" - shell: bash - run: "yum install -y centos-release-scl-rh" - - name: "Update compiler" - shell: bash - run: "yum install -y devtoolset-9-gcc devtoolset-9-gcc-c++" - - name: "Cache Git installation" - uses: actions/cache@v2.1.7 - with: - path: "/usr/local/git" - key: "centos7-git-2.26.2" - - name: "Install Git from source" - shell: bash - run: | - yum install -y wget curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker make - if test ! -x /usr/local/git/bin/git ; then - cd /tmp - wget https://github.com/git/git/archive/v2.26.2.tar.gz - tar xzf v2.26.2.tar.gz - cd git-2.26.2 - make prefix=/usr/local/git install - fi - ln -s /usr/local/git/bin/git /usr/local/bin/git - - name: "Install curl" - shell: bash - run: "yum install -y curl" - - name: "Ensure /run/sshd exists" - shell: bash - run: "mkdir -p /run/sshd" - - name: "Install openssh-server" - shell: bash - run: "yum install -y openssh-server" - - name: "checkout repo" - uses: actions/checkout@v2 - with: - submodules: "recursive" - - name: "Fetch tags" - shell: bash - run: "git fetch --depth=1 origin +refs/tags/*:refs/tags/*" - - name: "Fetch tag/branch history" - shell: bash - run: "git fetch --prune --unshallow" - - 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@v2.1.7 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: "centos7-None-2-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-cargo" - - name: "Install System Deps" - shell: bash - run: "env PATH=$PATH ./get-deps" - - name: "Check formatting" - shell: bash - run: "cargo fmt --all -- --check" - - name: "Build (Release mode)" - shell: bash - run: "source /opt/rh/devtoolset-9/enable && cargo build --all --release" - - name: "Test (Release mode)" - shell: bash - run: "source /opt/rh/devtoolset-9/enable && cargo test --all --release" - - name: "Package" - shell: bash - run: "bash ci/deploy.sh" - - name: "Move Package for artifact upload" - shell: bash - run: | - mkdir pkg_ - mv ~/rpmbuild/RPMS/*/*.rpm pkg_ - - name: "Upload artifact" - uses: actions/upload-artifact@master - with: - name: "centos7" - path: "pkg_" diff --git a/.github/workflows/gen_centos7_continuous.yml b/.github/workflows/gen_centos7_continuous.yml deleted file mode 100644 index 608eea6f6..000000000 --- a/.github/workflows/gen_centos7_continuous.yml +++ /dev/null @@ -1,129 +0,0 @@ -name: centos7_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/ISSUE_TEMPLATE/*" - - "**/*.md" - -jobs: - build: - runs-on: "ubuntu-latest" - container: "centos:7" - steps: - - name: "Install SCL" - shell: bash - run: | - export BUILD_REASON=Schedule - yum install -y centos-release-scl-rh - - name: "Update compiler" - shell: bash - run: | - export BUILD_REASON=Schedule - yum install -y devtoolset-9-gcc devtoolset-9-gcc-c++ - - name: "Cache Git installation" - uses: actions/cache@v2.1.7 - with: - path: "/usr/local/git" - key: "centos7-git-2.26.2" - - name: "Install Git from source" - shell: bash - run: | - export BUILD_REASON=Schedule - yum install -y wget curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker make - if test ! -x /usr/local/git/bin/git ; then - cd /tmp - wget https://github.com/git/git/archive/v2.26.2.tar.gz - tar xzf v2.26.2.tar.gz - cd git-2.26.2 - make prefix=/usr/local/git install - fi - ln -s /usr/local/git/bin/git /usr/local/bin/git - - name: "Install curl" - shell: bash - run: | - export BUILD_REASON=Schedule - yum install -y curl - - name: "Ensure /run/sshd exists" - shell: bash - run: | - export BUILD_REASON=Schedule - mkdir -p /run/sshd - - name: "Install openssh-server" - shell: bash - run: | - export BUILD_REASON=Schedule - yum install -y openssh-server - - name: "checkout repo" - uses: actions/checkout@v2 - with: - submodules: "recursive" - - name: "Fetch tags" - shell: bash - run: | - export BUILD_REASON=Schedule - git fetch --depth=1 origin +refs/tags/*:refs/tags/* - - name: "Fetch tag/branch history" - shell: bash - run: | - export BUILD_REASON=Schedule - git fetch --prune --unshallow - - 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@v2.1.7 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: "centos7-None-2-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-cargo" - - name: "Install System Deps" - shell: bash - run: | - export BUILD_REASON=Schedule - env PATH=$PATH ./get-deps - - name: "Build (Release mode)" - shell: bash - run: | - export BUILD_REASON=Schedule - source /opt/rh/devtoolset-9/enable && cargo build --all --release - - name: "Test (Release mode)" - shell: bash - run: | - export BUILD_REASON=Schedule - source /opt/rh/devtoolset-9/enable && cargo test --all --release - - name: "Package" - shell: bash - run: | - export BUILD_REASON=Schedule - bash ci/deploy.sh - - name: "Move RPM" - shell: bash - run: | - export BUILD_REASON=Schedule - mv ~/rpmbuild/RPMS/*/*.rpm wezterm-nightly-centos7.rpm - - name: "Upload to Nightly Release" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - shell: bash - run: | - export BUILD_REASON=Schedule - bash ci/retry.sh gh release upload --clobber nightly wezterm-*.rpm diff --git a/.github/workflows/gen_centos7_tag.yml b/.github/workflows/gen_centos7_tag.yml deleted file mode 100644 index d2b7430e2..000000000 --- a/.github/workflows/gen_centos7_tag.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: centos7_tag - -on: - push: - tags: - - "20*" - -jobs: - build: - runs-on: "ubuntu-latest" - container: "centos:7" - steps: - - name: "Install SCL" - shell: bash - run: "yum install -y centos-release-scl-rh" - - name: "Update compiler" - shell: bash - run: "yum install -y devtoolset-9-gcc devtoolset-9-gcc-c++" - - name: "Cache Git installation" - uses: actions/cache@v2.1.7 - with: - path: "/usr/local/git" - key: "centos7-git-2.26.2" - - name: "Install Git from source" - shell: bash - run: | - yum install -y wget curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker make - if test ! -x /usr/local/git/bin/git ; then - cd /tmp - wget https://github.com/git/git/archive/v2.26.2.tar.gz - tar xzf v2.26.2.tar.gz - cd git-2.26.2 - make prefix=/usr/local/git install - fi - ln -s /usr/local/git/bin/git /usr/local/bin/git - - name: "Install curl" - shell: bash - run: "yum install -y curl" - - name: "Ensure /run/sshd exists" - shell: bash - run: "mkdir -p /run/sshd" - - name: "Install openssh-server" - shell: bash - run: "yum install -y openssh-server" - - name: "checkout repo" - uses: actions/checkout@v2 - with: - submodules: "recursive" - - name: "Fetch tags" - shell: bash - run: "git fetch --depth=1 origin +refs/tags/*:refs/tags/*" - - name: "Fetch tag/branch history" - shell: bash - run: "git fetch --prune --unshallow" - - 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@v2.1.7 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: "centos7-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: "source /opt/rh/devtoolset-9/enable && cargo build --all --release" - - name: "Test (Release mode)" - shell: bash - run: "source /opt/rh/devtoolset-9/enable && cargo test --all --release" - - name: "Package" - shell: bash - run: "bash ci/deploy.sh" - - name: "Move RPM" - shell: bash - run: "mv ~/rpmbuild/RPMS/*/*.rpm ." - - name: "Create pre-release" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - shell: bash - run: "bash ci/retry.sh bash ci/create-release.sh ${{ github.event.release.tag_name }}" - - name: "Upload to Tagged Release" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - shell: bash - run: "bash ci/retry.sh gh release upload --clobber ${ github.event.release.tag_name } wezterm-*.rpm" diff --git a/.github/workflows/gen_centos8.yml b/.github/workflows/gen_centos8.yml index 12af78e00..cfc61653c 100644 --- a/.github/workflows/gen_centos8.yml +++ b/.github/workflows/gen_centos8.yml @@ -25,6 +25,12 @@ jobs: - name: "Enable PowerTools" shell: bash run: "dnf config-manager --set-enabled powertools" + - name: "Enable GH CLI repo" + shell: bash + run: "dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo" + - name: "Install GH CLI" + shell: bash + run: "dnf install gh" - name: "Install git" shell: bash run: "yum install -y git" diff --git a/.github/workflows/gen_centos8_continuous.yml b/.github/workflows/gen_centos8_continuous.yml index f5df73d2f..ad8c491d0 100644 --- a/.github/workflows/gen_centos8_continuous.yml +++ b/.github/workflows/gen_centos8_continuous.yml @@ -31,6 +31,16 @@ jobs: run: | export BUILD_REASON=Schedule dnf config-manager --set-enabled powertools + - name: "Enable GH CLI repo" + shell: bash + run: | + export BUILD_REASON=Schedule + dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo + - name: "Install GH CLI" + shell: bash + run: | + export BUILD_REASON=Schedule + dnf install gh - name: "Install git" shell: bash run: | diff --git a/.github/workflows/gen_centos8_tag.yml b/.github/workflows/gen_centos8_tag.yml index 2e29c187e..5b154dd1d 100644 --- a/.github/workflows/gen_centos8_tag.yml +++ b/.github/workflows/gen_centos8_tag.yml @@ -16,6 +16,12 @@ jobs: - name: "Enable PowerTools" shell: bash run: "dnf config-manager --set-enabled powertools" + - name: "Enable GH CLI repo" + shell: bash + run: "dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo" + - name: "Install GH CLI" + shell: bash + run: "dnf install gh" - name: "Install git" shell: bash run: "yum install -y git" diff --git a/.github/workflows/gen_debian10.3.yml b/.github/workflows/gen_debian10.3.yml index aa0d376f0..5f92e3129 100644 --- a/.github/workflows/gen_debian10.3.yml +++ b/.github/workflows/gen_debian10.3.yml @@ -22,9 +22,18 @@ jobs: - name: "set APT to non-interactive" shell: bash run: "echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections" + - name: "Install GitHub keyring" + shell: bash + run: "curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg" + - name: "Add GitHub package list" + shell: bash + run: "echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\" | {sudo} tee /etc/apt/sources.list.d/github-cli.list > /dev/null" - name: "Update APT" shell: bash run: "apt update" + - name: "Install GH CLI" + shell: bash + run: " apt install gh" - name: "Install git" shell: bash run: "apt-get install -y git" diff --git a/.github/workflows/gen_debian10.3_continuous.yml b/.github/workflows/gen_debian10.3_continuous.yml index c10834545..1a7dc676b 100644 --- a/.github/workflows/gen_debian10.3_continuous.yml +++ b/.github/workflows/gen_debian10.3_continuous.yml @@ -26,11 +26,26 @@ jobs: run: | export BUILD_REASON=Schedule echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + - name: "Install GitHub keyring" + shell: bash + run: | + export BUILD_REASON=Schedule + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg + - name: "Add GitHub package list" + shell: bash + run: | + export BUILD_REASON=Schedule + echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\" | {sudo} tee /etc/apt/sources.list.d/github-cli.list > /dev/null - name: "Update APT" shell: bash run: | export BUILD_REASON=Schedule apt update + - name: "Install GH CLI" + shell: bash + run: | + export BUILD_REASON=Schedule + apt install gh - name: "Install git" shell: bash run: | diff --git a/.github/workflows/gen_debian10.3_tag.yml b/.github/workflows/gen_debian10.3_tag.yml index 40d3d3f73..c5d984755 100644 --- a/.github/workflows/gen_debian10.3_tag.yml +++ b/.github/workflows/gen_debian10.3_tag.yml @@ -13,9 +13,18 @@ jobs: - name: "set APT to non-interactive" shell: bash run: "echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections" + - name: "Install GitHub keyring" + shell: bash + run: "curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg" + - name: "Add GitHub package list" + shell: bash + run: "echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\" | {sudo} tee /etc/apt/sources.list.d/github-cli.list > /dev/null" - name: "Update APT" shell: bash run: "apt update" + - name: "Install GH CLI" + shell: bash + run: " apt install gh" - name: "Install git" shell: bash run: "apt-get install -y git" diff --git a/.github/workflows/gen_debian11.yml b/.github/workflows/gen_debian11.yml index a2bb2ec1d..da2c10394 100644 --- a/.github/workflows/gen_debian11.yml +++ b/.github/workflows/gen_debian11.yml @@ -22,9 +22,18 @@ jobs: - name: "set APT to non-interactive" shell: bash run: "echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections" + - name: "Install GitHub keyring" + shell: bash + run: "curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg" + - name: "Add GitHub package list" + shell: bash + run: "echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\" | {sudo} tee /etc/apt/sources.list.d/github-cli.list > /dev/null" - name: "Update APT" shell: bash run: "apt update" + - name: "Install GH CLI" + shell: bash + run: " apt install gh" - name: "Install git" shell: bash run: "apt-get install -y git" diff --git a/.github/workflows/gen_debian11_continuous.yml b/.github/workflows/gen_debian11_continuous.yml index d141a5f91..c3dbd6c10 100644 --- a/.github/workflows/gen_debian11_continuous.yml +++ b/.github/workflows/gen_debian11_continuous.yml @@ -26,11 +26,26 @@ jobs: run: | export BUILD_REASON=Schedule echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + - name: "Install GitHub keyring" + shell: bash + run: | + export BUILD_REASON=Schedule + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg + - name: "Add GitHub package list" + shell: bash + run: | + export BUILD_REASON=Schedule + echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\" | {sudo} tee /etc/apt/sources.list.d/github-cli.list > /dev/null - name: "Update APT" shell: bash run: | export BUILD_REASON=Schedule apt update + - name: "Install GH CLI" + shell: bash + run: | + export BUILD_REASON=Schedule + apt install gh - name: "Install git" shell: bash run: | diff --git a/.github/workflows/gen_debian11_tag.yml b/.github/workflows/gen_debian11_tag.yml index 4f2d22728..52b50dc5f 100644 --- a/.github/workflows/gen_debian11_tag.yml +++ b/.github/workflows/gen_debian11_tag.yml @@ -13,9 +13,18 @@ jobs: - name: "set APT to non-interactive" shell: bash run: "echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections" + - name: "Install GitHub keyring" + shell: bash + run: "curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg" + - name: "Add GitHub package list" + shell: bash + run: "echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\" | {sudo} tee /etc/apt/sources.list.d/github-cli.list > /dev/null" - name: "Update APT" shell: bash run: "apt update" + - name: "Install GH CLI" + shell: bash + run: " apt install gh" - name: "Install git" shell: bash run: "apt-get install -y git" diff --git a/.github/workflows/gen_debian9.12.yml b/.github/workflows/gen_debian9.12.yml index 440bfadbb..140a9484b 100644 --- a/.github/workflows/gen_debian9.12.yml +++ b/.github/workflows/gen_debian9.12.yml @@ -22,9 +22,18 @@ jobs: - name: "set APT to non-interactive" shell: bash run: "echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections" + - name: "Install GitHub keyring" + shell: bash + run: "curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg" + - name: "Add GitHub package list" + shell: bash + run: "echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\" | {sudo} tee /etc/apt/sources.list.d/github-cli.list > /dev/null" - name: "Update APT" shell: bash run: "apt update" + - name: "Install GH CLI" + shell: bash + run: " apt install gh" - name: "Cache Git installation" uses: actions/cache@v2.1.7 with: diff --git a/.github/workflows/gen_debian9.12_continuous.yml b/.github/workflows/gen_debian9.12_continuous.yml index 3d40bed67..5e523eb6f 100644 --- a/.github/workflows/gen_debian9.12_continuous.yml +++ b/.github/workflows/gen_debian9.12_continuous.yml @@ -26,11 +26,26 @@ jobs: run: | export BUILD_REASON=Schedule echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + - name: "Install GitHub keyring" + shell: bash + run: | + export BUILD_REASON=Schedule + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg + - name: "Add GitHub package list" + shell: bash + run: | + export BUILD_REASON=Schedule + echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\" | {sudo} tee /etc/apt/sources.list.d/github-cli.list > /dev/null - name: "Update APT" shell: bash run: | export BUILD_REASON=Schedule apt update + - name: "Install GH CLI" + shell: bash + run: | + export BUILD_REASON=Schedule + apt install gh - name: "Cache Git installation" uses: actions/cache@v2.1.7 with: diff --git a/.github/workflows/gen_debian9.12_tag.yml b/.github/workflows/gen_debian9.12_tag.yml index e2da34836..e9e95bf77 100644 --- a/.github/workflows/gen_debian9.12_tag.yml +++ b/.github/workflows/gen_debian9.12_tag.yml @@ -13,9 +13,18 @@ jobs: - name: "set APT to non-interactive" shell: bash run: "echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections" + - name: "Install GitHub keyring" + shell: bash + run: "curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg" + - name: "Add GitHub package list" + shell: bash + run: "echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\" | {sudo} tee /etc/apt/sources.list.d/github-cli.list > /dev/null" - name: "Update APT" shell: bash run: "apt update" + - name: "Install GH CLI" + shell: bash + run: " apt install gh" - name: "Cache Git installation" uses: actions/cache@v2.1.7 with: diff --git a/.github/workflows/gen_fedora33.yml b/.github/workflows/gen_fedora33.yml index 4fd4604ef..a1aa3818f 100644 --- a/.github/workflows/gen_fedora33.yml +++ b/.github/workflows/gen_fedora33.yml @@ -19,6 +19,12 @@ jobs: runs-on: "ubuntu-latest" container: "fedora:33" steps: + - name: "Enable GH CLI repo" + shell: bash + run: "dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo" + - name: "Install GH CLI" + shell: bash + run: "dnf install gh" - name: "Install git" shell: bash run: "yum install -y git" diff --git a/.github/workflows/gen_fedora33_continuous.yml b/.github/workflows/gen_fedora33_continuous.yml index 142c83cce..922c15372 100644 --- a/.github/workflows/gen_fedora33_continuous.yml +++ b/.github/workflows/gen_fedora33_continuous.yml @@ -21,6 +21,16 @@ jobs: runs-on: "ubuntu-latest" container: "fedora:33" steps: + - name: "Enable GH CLI repo" + shell: bash + run: | + export BUILD_REASON=Schedule + dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo + - name: "Install GH CLI" + shell: bash + run: | + export BUILD_REASON=Schedule + dnf install gh - name: "Install git" shell: bash run: | diff --git a/.github/workflows/gen_fedora33_tag.yml b/.github/workflows/gen_fedora33_tag.yml index 856fdea9c..dda72f5fb 100644 --- a/.github/workflows/gen_fedora33_tag.yml +++ b/.github/workflows/gen_fedora33_tag.yml @@ -10,6 +10,12 @@ jobs: runs-on: "ubuntu-latest" container: "fedora:33" steps: + - name: "Enable GH CLI repo" + shell: bash + run: "dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo" + - name: "Install GH CLI" + shell: bash + run: "dnf install gh" - name: "Install git" shell: bash run: "yum install -y git" diff --git a/.github/workflows/gen_fedora34.yml b/.github/workflows/gen_fedora34.yml index a7a002b1b..f00d3ec54 100644 --- a/.github/workflows/gen_fedora34.yml +++ b/.github/workflows/gen_fedora34.yml @@ -19,6 +19,12 @@ jobs: runs-on: "ubuntu-latest" container: "fedora:34" steps: + - name: "Enable GH CLI repo" + shell: bash + run: "dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo" + - name: "Install GH CLI" + shell: bash + run: "dnf install gh" - name: "Install git" shell: bash run: "yum install -y git" diff --git a/.github/workflows/gen_fedora34_continuous.yml b/.github/workflows/gen_fedora34_continuous.yml index fd0ab4e24..c6ec82097 100644 --- a/.github/workflows/gen_fedora34_continuous.yml +++ b/.github/workflows/gen_fedora34_continuous.yml @@ -21,6 +21,16 @@ jobs: runs-on: "ubuntu-latest" container: "fedora:34" steps: + - name: "Enable GH CLI repo" + shell: bash + run: | + export BUILD_REASON=Schedule + dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo + - name: "Install GH CLI" + shell: bash + run: | + export BUILD_REASON=Schedule + dnf install gh - name: "Install git" shell: bash run: | diff --git a/.github/workflows/gen_fedora34_tag.yml b/.github/workflows/gen_fedora34_tag.yml index d6d9bb6e2..d57abf54d 100644 --- a/.github/workflows/gen_fedora34_tag.yml +++ b/.github/workflows/gen_fedora34_tag.yml @@ -10,6 +10,12 @@ jobs: runs-on: "ubuntu-latest" container: "fedora:34" steps: + - name: "Enable GH CLI repo" + shell: bash + run: "dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo" + - name: "Install GH CLI" + shell: bash + run: "dnf install gh" - name: "Install git" shell: bash run: "yum install -y git" diff --git a/.github/workflows/gen_fedora35.yml b/.github/workflows/gen_fedora35.yml index a288424e3..ae9ad4833 100644 --- a/.github/workflows/gen_fedora35.yml +++ b/.github/workflows/gen_fedora35.yml @@ -19,6 +19,12 @@ jobs: runs-on: "ubuntu-latest" container: "fedora:35" steps: + - name: "Enable GH CLI repo" + shell: bash + run: "dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo" + - name: "Install GH CLI" + shell: bash + run: "dnf install gh" - name: "Install git" shell: bash run: "yum install -y git" diff --git a/.github/workflows/gen_fedora35_continuous.yml b/.github/workflows/gen_fedora35_continuous.yml index bf9ceb690..283315f48 100644 --- a/.github/workflows/gen_fedora35_continuous.yml +++ b/.github/workflows/gen_fedora35_continuous.yml @@ -21,6 +21,16 @@ jobs: runs-on: "ubuntu-latest" container: "fedora:35" steps: + - name: "Enable GH CLI repo" + shell: bash + run: | + export BUILD_REASON=Schedule + dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo + - name: "Install GH CLI" + shell: bash + run: | + export BUILD_REASON=Schedule + dnf install gh - name: "Install git" shell: bash run: | diff --git a/.github/workflows/gen_fedora35_tag.yml b/.github/workflows/gen_fedora35_tag.yml index 370554a91..ec52e52fc 100644 --- a/.github/workflows/gen_fedora35_tag.yml +++ b/.github/workflows/gen_fedora35_tag.yml @@ -10,6 +10,12 @@ jobs: runs-on: "ubuntu-latest" container: "fedora:35" steps: + - name: "Enable GH CLI repo" + shell: bash + run: "dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo" + - name: "Install GH CLI" + shell: bash + run: "dnf install gh" - name: "Install git" shell: bash run: "yum install -y git" diff --git a/.github/workflows/gen_ubuntu20.04.yml b/.github/workflows/gen_ubuntu20.04.yml index e6cbb8512..397b73709 100644 --- a/.github/workflows/gen_ubuntu20.04.yml +++ b/.github/workflows/gen_ubuntu20.04.yml @@ -16,27 +16,15 @@ on: jobs: build: - runs-on: "ubuntu-latest" - container: "ubuntu:20.04" + runs-on: "ubuntu-20.04" + steps: - - name: "set APT to non-interactive" - shell: bash - run: "echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections" - name: "Update APT" shell: bash - run: "apt update" + run: "sudo -n apt update" - name: "Install git" shell: bash - run: "apt-get install -y git" - - name: "Install curl" - shell: bash - run: "apt-get install -y curl" - - name: "Ensure /run/sshd exists" - shell: bash - run: "mkdir -p /run/sshd" - - name: "Install openssh-server" - shell: bash - run: "apt-get install -y openssh-server" + run: "sudo -n apt-get install -y git" - name: "checkout repo" uses: actions/checkout@v2 with: @@ -66,7 +54,7 @@ jobs: key: "ubuntu20.04-None-2-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-cargo" - name: "Install System Deps" shell: bash - run: "env PATH=$PATH ./get-deps" + run: "sudo -n env PATH=$PATH ./get-deps" - name: "Check formatting" shell: bash run: "cargo fmt --all -- --check" diff --git a/.github/workflows/gen_ubuntu20.04_continuous.yml b/.github/workflows/gen_ubuntu20.04_continuous.yml index eed3663da..ec23eb659 100644 --- a/.github/workflows/gen_ubuntu20.04_continuous.yml +++ b/.github/workflows/gen_ubuntu20.04_continuous.yml @@ -18,39 +18,19 @@ on: jobs: build: - runs-on: "ubuntu-latest" - container: "ubuntu:20.04" + runs-on: "ubuntu-20.04" + steps: - - name: "set APT to non-interactive" - shell: bash - run: | - export BUILD_REASON=Schedule - echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections - name: "Update APT" shell: bash run: | export BUILD_REASON=Schedule - apt update + sudo -n apt update - name: "Install git" shell: bash run: | export BUILD_REASON=Schedule - apt-get install -y git - - name: "Install curl" - shell: bash - run: | - export BUILD_REASON=Schedule - apt-get install -y curl - - name: "Ensure /run/sshd exists" - shell: bash - run: | - export BUILD_REASON=Schedule - mkdir -p /run/sshd - - name: "Install openssh-server" - shell: bash - run: | - export BUILD_REASON=Schedule - apt-get install -y openssh-server + sudo -n apt-get install -y git - name: "checkout repo" uses: actions/checkout@v2 with: @@ -86,7 +66,7 @@ jobs: shell: bash run: | export BUILD_REASON=Schedule - env PATH=$PATH ./get-deps + sudo -n env PATH=$PATH ./get-deps - name: "Build (Release mode)" shell: bash run: | diff --git a/.github/workflows/gen_ubuntu20.04_tag.yml b/.github/workflows/gen_ubuntu20.04_tag.yml index 5442789bf..462817676 100644 --- a/.github/workflows/gen_ubuntu20.04_tag.yml +++ b/.github/workflows/gen_ubuntu20.04_tag.yml @@ -7,27 +7,15 @@ on: jobs: build: - runs-on: "ubuntu-latest" - container: "ubuntu:20.04" + runs-on: "ubuntu-20.04" + steps: - - name: "set APT to non-interactive" - shell: bash - run: "echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections" - name: "Update APT" shell: bash - run: "apt update" + run: "sudo -n apt update" - name: "Install git" shell: bash - run: "apt-get install -y git" - - name: "Install curl" - shell: bash - run: "apt-get install -y curl" - - name: "Ensure /run/sshd exists" - shell: bash - run: "mkdir -p /run/sshd" - - name: "Install openssh-server" - shell: bash - run: "apt-get install -y openssh-server" + run: "sudo -n apt-get install -y git" - name: "checkout repo" uses: actions/checkout@v2 with: @@ -57,7 +45,7 @@ jobs: key: "ubuntu20.04-None-2-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-cargo" - name: "Install System Deps" shell: bash - run: "env PATH=$PATH ./get-deps" + run: "sudo -n env PATH=$PATH ./get-deps" - name: "Build (Release mode)" shell: bash run: "cargo build --all --release" diff --git a/ci/generate-workflows.py b/ci/generate-workflows.py index bfc1607ca..8b9dc98a2 100755 --- a/ci/generate-workflows.py +++ b/ci/generate-workflows.py @@ -485,17 +485,28 @@ cargo build --all --release""", def prep_environment(self, cache=True): steps = [] if self.uses_apt(): + sudo = "sudo -n " if self.needs_sudo() else "" if self.container: steps += [ RunStep( "set APT to non-interactive", "echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections", ), + RunStep( + "Install GitHub keyring", + f"curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | {sudo} dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg", + ), + RunStep( + "Add GitHub package list", + 'echo \\"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main\\" | {sudo} tee /etc/apt/sources.list.d/github-cli.list > /dev/null', + ), ] - sudo = "sudo -n " if self.needs_sudo() else "" steps += [ RunStep("Update APT", f"{sudo}apt update"), ] + if self.container: + steps += [RunStep("Install GH CLI", f"{sudo} apt install gh")] + if self.container: if self.container == "centos:8": steps += [ @@ -508,6 +519,17 @@ cargo build --all --release""", "dnf config-manager --set-enabled powertools", ), ] + if ("fedora" in self.container) or ("centos" in self.container): + steps += [ + RunStep( + "Enable GH CLI repo", + "dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo", + ), + RunStep( + "Install GH CLI", + "dnf install gh", + ), + ] steps += self.install_newer_compiler() steps += self.install_git() steps += self.install_curl() @@ -574,7 +596,7 @@ cargo build --all --release""", TARGETS = [ Target(name="ubuntu:18", os="ubuntu-18.04", app_image=True), - Target(container="ubuntu:20.04", continuous_only=True), + Target(name="ubuntu:20.04", os="ubuntu-20.04", continuous_only=True), # debian 8's wayland libraries are too old for wayland-client # Target(container="debian:8.11", continuous_only=True, bootstrap_git=True), Target(container="debian:9.12", continuous_only=True, bootstrap_git=True), @@ -585,7 +607,6 @@ TARGETS = [ Target(container="fedora:33"), Target(container="fedora:34"), Target(container="fedora:35"), - Target(container="centos:7", bootstrap_git=True), Target(container="centos:8"), Target(name="windows", os="windows-latest", rust_target="x86_64-pc-windows-msvc"), ]