Skip to content

RCM_CI

RCM_CI #264

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: RCM_CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: ["dev"]
tags:
- v*
pull_request:
branches: ["dev"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
RCM_CHECKOUT: "."
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
strategy:
matrix:
os:
- windows-2022
- ubuntu-24.04
- ubuntu-22.04
- ubuntu-20.04
turbovnc-version:
- "3.1"
- "2.2.7"
include:
- os: macos-13
turbovnc-version: "none"
- os: macos-14
turbovnc-version: "none"
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
permissions:
attestations: write
contents: write
id-token: write
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Install Qt missing libraries (linux only)
uses: awalsh128/cache-apt-pkgs-action@latest
if: ${{ contains(matrix.os, 'ubuntu') }}
with:
packages: qtbase5-dev qt5-qmake qtwayland5
version: 1.0-${{ matrix.os }}
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout RCM
uses: actions/[email protected]
- name: Setup environment from yaml
uses: carlkidcrypto/[email protected]
with:
macos: |
sed "s/- //;s/: /=/;s/=[\"']/=/;s/[\"']$//" "${{ env.RCM_CHECKOUT }}/scripts/ci/common_vars.yaml" | grep -v "^#" >> "${GITHUB_ENV}"
echo "EXT=" >> "${GITHUB_ENV}"
linux: |
sed "s/- //;s/: /=/;s/=[\"']/=/;s/[\"']$//" "${{ env.RCM_CHECKOUT }}/scripts/ci/common_vars.yaml" | grep -v "^#" >> "${GITHUB_ENV}"
echo "EXT=" >> "${GITHUB_ENV}"
windows: |
[regex]$Match1 = "^- "
[regex]$Match2 = ": [`"']"
[regex]$Match3 = "[`"']$"
foreach($line in Get-Content "${{ env.RCM_CHECKOUT }}\scripts\ci\common_vars.yaml" | Where-Object { $_ -notmatch '^\s*#' }){
echo $Match3.replace($Match2.replace($Match1.replace($line, '', 1), '=', 1), '', 1) >> "${env:GITHUB_ENV}"
}
echo "EXT=.exe" >> "${env:GITHUB_ENV}"
- name: Define artifact basename
uses: carlkidcrypto/[email protected]
env:
RUNNER_ARCH: ${{ runner.arch }}
with:
macos: |
runner_arch=$(echo "${RUNNER_ARCH}" | tr '[:upper:]' '[:lower:]')
echo "ARTIFACT_BASENAME=RCM-client_${{ matrix.os }}_${runner_arch}" >> "${GITHUB_ENV}"
linux: echo "ARTIFACT_BASENAME=RCM-client_${{ matrix.os }}_${RUNNER_ARCH,,}_turbovnc_${{ matrix.turbovnc-version }}" >> "${GITHUB_ENV}"
windows: |
$runner_arch=${env:RUNNER_ARCH}.toLower()
echo "ARTIFACT_BASENAME=RCM-client_${{ matrix.os }}_${runner_arch}_turbovnc_${{ matrix.turbovnc-version }}" >> "${env:GITHUB_ENV}"
# CACHE
- name: (GHO) Cache pyenv
uses: actions/[email protected]
id: cache-pyenv
with:
path: .pyenv
key: pyenv-${{ env.PYENV_VERSION }}-python-${{ env.PYTHON_VERSION }}-${{ matrix.os }}-${{ hashFiles('scripts/ci/02-install-python.*') }}
- name: (GHO) Cache venv
uses: actions/[email protected]
id: cache-venv
with:
path: .venv
key: venv-python-${{ env.PYTHON_VERSION }}-paramiko-${{ env.PARAMIKO_PULL }}-${{env.PARAMIKO_COMMIT}}-${{ matrix.os }}-${{ hashFiles('scripts/ci/03-install-venv.*', '**/requirements.txt') }}
- name: (GHO) Cache turbovnc
uses: actions/[email protected]
id: cache-turbovnc
with:
path: ${{ env.RCM_CHECKOUT }}/${{ env.TURBOVNC_EXTERNAL }}
key: turbovnc-${{ matrix.turbovnc-version }}-${{ matrix.os }}-${{ hashFiles('scripts/ci/04*') }}
- name: (GHO) Cache step
uses: actions/[email protected]
id: cache-step
with:
path: ${{ env.RCM_CHECKOUT }}/${{ env.SMALLSTEP_EXTERNAL }}-${{ hashFiles('scripts/ci/05*') }}
key: step-${{ matrix.os }}
# PYTHON
- name: Setup pyenv environment
uses: carlkidcrypto/[email protected]
with:
macos: . "${RCM_CHECKOUT}/scripts/ci/01-setup-pyenv.sh"
linux: . "${RCM_CHECKOUT}/scripts/ci/01-setup-pyenv.sh"
windows: . "${env:RCM_CHECKOUT}\scripts\ci\01-setup-pyenv.ps1"
- name: Install pyenv locally
if: ${{steps.cache-pyenv.outputs.cache-hit != 'true' }}
uses: carlkidcrypto/[email protected]
with:
macos: . "${RCM_CHECKOUT}/scripts/ci/02-install-python.sh"
linux: . "${RCM_CHECKOUT}/scripts/ci/02-install-python.sh"
windows: . "${env:RCM_CHECKOUT}\scripts\ci\02-install-python.ps1"
# VENV
- name: Install venv
uses: carlkidcrypto/[email protected]
if: ${{ steps.cache-venv.outputs.cache-hit != 'true' }}
with:
macos: . "${RCM_CHECKOUT}/scripts/ci/03-install-venv.sh"
linux: . "${RCM_CHECKOUT}/scripts/ci/03-install-venv.sh"
windows: . "${env:RCM_CHECKOUT}\scripts\ci\03-install-venv.ps1"
# TURBOVNC
- name: Extract TurboVNC
uses: carlkidcrypto/[email protected]
if: ${{ steps.cache-turbovnc.outputs.cache-hit != 'true' }}
env:
TURBOVNC_VERSION: ${{ matrix.turbovnc-version }}
with:
linux: . "${RCM_CHECKOUT}/scripts/ci/04a-extract-turbovnc-ubuntu.sh"
windows: . "${env:RCM_CHECKOUT}\scripts\ci\04a-extract-turbovnc.ps1"
- name: Patch TurboVNC 3.x
uses: carlkidcrypto/[email protected]
if: ${{ steps.cache-turbovnc.outputs.cache-hit != 'true' && startsWith(matrix.turbovnc-version, '3') }}
env:
ORIG_LINE: "jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA,"
NEW_LINE: "jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA,"
with:
linux: . "${RCM_CHECKOUT}/scripts/ci/04b-patch-turbovnc-linux.sh"
windows: . "${env:RCM_CHECKOUT}\scripts\ci\04b-patch-turbovnc.ps1"
# EXTERNAL STEP
- name: External step
uses: carlkidcrypto/[email protected]
if: ${{ steps.cache-step.outputs.cache-hit != 'true' }}
with:
linux: . "${RCM_CHECKOUT}/scripts/ci/05-extract-step-linux.sh"
windows: . "${env:RCM_CHECKOUT}\scripts\ci\05-extract-step.ps1"
# EXTERNAL PLINK
- name: External plink (windows)
uses: carlkidcrypto/[email protected]
with:
windows: . "${env:RCM_CHECKOUT}\scripts\ci\06-download-plink.ps1"
# PYINSTALLER
- name: Build pyinstaller
uses: carlkidcrypto/[email protected]
with:
macos: |
source .venv/bin/activate
pyinstaller "${RCM_CHECKOUT}/rcm/client/rcm_client_qt.spec"
linux: |
source .venv/bin/activate
pyinstaller "${RCM_CHECKOUT}/rcm/client/rcm_client_qt.spec"
windows: |
.venv\Scripts\Activate.ps1
pyinstaller "${env:RCM_CHECKOUT}\rcm\client\rcm_client_qt.spec"
# ARTIFACT
- name: (GHO) Move preartifacts
shell: bash
run: |
# https://github.com/actions/upload-artifact?tab=readme-ov-file#permission-loss
mv rcm rcm_bck
find dist -type f -name "RCM${{ env.EXT }}" -exec cp '{}' . \;
find dist -type f -name "RCM.zip" -exec cp '{}' . \;
- name: (Attestation) Attest RCM executable
uses: actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3
with:
subject-path: RCM${{ env.EXT }}
subject-name: ${{ env.ARTIFACT_BASENAME }}
- name: (Attestation) Attest RCM zip
uses: actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3
with:
subject-path: RCM.zip
subject-name: ${{ env.ARTIFACT_BASENAME }}-dir
- name: (GHO)(TAG) Upload exe to release
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
uses: svenstaro/upload-release-action@v2
with:
file: RCM${{ env.EXT }}
asset_name: ${{ env.ARTIFACT_BASENAME }}-${{ github.ref_name }}${{ env.EXT }}
prerelease: true
overwrite: true
tag: ${{ github.ref }}
- name: (GHO)(TAG) Upload exe to release
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
uses: svenstaro/upload-release-action@v2
with:
file: RCM.zip
asset_name: ${{ env.ARTIFACT_BASENAME }}-${{ github.ref_name }}.zip
prerelease: true
overwrite: true
tag: ${{ github.ref }}
- name: (GHO) Upload artifact exe
if: ${{ github.event_name != 'push' && !contains(github.ref, 'refs/tags/') }}
uses: actions/[email protected]
with:
name: ${{ env.ARTIFACT_BASENAME }}-${{ github.sha }}
path: RCM${{ env.EXT }}
- name: (GHO) Upload artifact dir
if: ${{ github.event_name != 'push' && !contains(github.ref, 'refs/tags/') }}
uses: actions/[email protected]
with:
name: ${{ env.ARTIFACT_BASENAME }}-${{ github.sha }}-dir
path: RCM.zip
- name: (Attestation) Verify RCM executable and zip
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
gh attestation verify "RCM${{ env.EXT }}" --owner "${GITHUB_REPOSITORY_OWNER}"
gh attestation verify "RCM.zip" --owner "${GITHUB_REPOSITORY_OWNER}"
- name: (GHO) Restore RCM-repo
shell: bash
run: |
rm -rf RCM RCM.exe RCM-dir
mv rcm_bck rcm
nightly-link:
runs-on: ubuntu-latest
if: ${{ always() }} && ${{ github.event_name != 'push' && !contains(github.ref, 'refs/tags/') }}
steps:
- name: Generate Annotation
run: |
url="https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}"
echo "::notice title=Download the artificats from nightly.link (without logging in) by visiting the URL below::$url"