Skip to content

RCM_CI_win

RCM_CI_win #90

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: RCM_CI_win
# 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" ]
pull_request:
branches: [ "dev" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
RCM_CHECKOUT: "RCM"
PYTHON_VERSION: "3.10.11"
TURBOVNC_DOWNLOAD: "https://github.com/TurboVNC/turbovnc/releases/download"
TURBOVNC_EXTERNAL: "rcm/client/external/turbovnc"
PARAMIKO_PULL: "2258"
PARAMIKO_COMMIT: "1a45c7ec74cf8ee1d537e3ca032e7fef40fa62b3"
# 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"
python:
# The type of runner that the job will run on
runs-on: windows-latest
strategy:
matrix:
turbovnc-version:
- '3.1'
- '2.2.7'
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# CHECKOUT
- name: Checkout RCM
uses: actions/[email protected]
with:
path: ${{ env.RCM_CHECKOUT }}
# CACHE
- name: (GHO) Cache python
uses: actions/[email protected]
id: cache-python
with:
path: python
key: python-${{ env.PYTHON_VERSION }}-${{ runner.os }}
- name: (GHO) Cache venv
uses: actions/[email protected]
id: cache-venv
with:
path: venv
key: venv-${{ hashFiles( format('{0}/rcm/client/requirements.txt', env.RCM_CHECKOUT ) ) }}-paramiko-${{ env.PARAMIKO_PULL }}-${{env.PARAMIKO_COMMIT}}-${{ runner.os }}
- name: (GHO) Cache turbovnc
uses: actions/[email protected]
id: cache-turbovnc
with:
path: turbovnc
key: turbovnc-${{ matrix.turbovnc-version }}-${{ runner.os }}
# PYTHON
- name: Install python locally
if: ${{ steps.cache-python.outputs.cache-hit != 'true' }}
run: . "${{ env.RCM_CHECKOUT }}/scripts/ci/install_local_python.ps1"
# VENV
- name: Set up PATH on Windows
if: runner.os == 'Windows'
run: echo "C:\Program Files\Git\usr\bin" >> $env:GITHUB_PATH
- name: Install venv
if: ${{ steps.cache-venv.outputs.cache-hit != 'true' }}
run: |
python\python.exe -m venv venv
venv\Scripts\Activate.ps1
pip install -r "${env:RCM_CHECKOUT}\rcm\client\requirements.txt"
Invoke-WebRequest -URI https://github.com/paramiko/paramiko/pull/2258/commits/1a45c7ec74cf8ee1d537e3ca032e7fef40fa62b3.patch -OutFile paramiko.patch
$env:PARAMIKO_FILE = python -c "import paramiko, os; print(os.path.join(os.path.dirname(paramiko.__file__), 'auth_handler.py'))"
patch -N $env:PARAMIKO_FILE -i paramiko.patch
# TURBOVNC
- name: Extract turbovnc
if: ${{ steps.cache-turbovnc.outputs.cache-hit != 'true' }}
env:
TURBOVNC_VERSION: ${{ matrix.turbovnc-version }}
run: . "${{ env.RCM_CHECKOUT }}/scripts/ci/extract_turbovnc.ps1"
- name: Move turbovnc to external
run: |
mkdir "${{ env.RCM_CHECKOUT }}\${{ env.TURBOVNC_EXTERNAL }}"
mv turbovnc "${{ env.RCM_CHECKOUT }}/${{ env.TURBOVNC_EXTERNAL }}/bin"
# PYINSTALLER
- name: Build pyinstaller
run: |
venv\Scripts\Activate.ps1
pyinstaller "${{ env.RCM_CHECKOUT }}\rcm\client\rcm_client_qt.spec"
# ARTIFACT
- name: (GHO) Move preartifacts
run: |
cp dist/*/*/RCM.exe .
Expand-Archive -Path dist/*/*/RCM.zip -DestinationPath ./RCM-dir
- uses: sigstore/[email protected]
- name: Sign image with a key
run: |
cosign sign-blob --yes --key env://COSIGN_PRIVATE_KEY --output-signature "${{ env.FILE2SIGN }}.sig" "${{ env.FILE2SIGN }}.exe"
cosign verify-blob --key env://COSIGN_PUBLIC_KEY --signature "${{ env.FILE2SIGN }}.sig" "${{ env.FILE2SIGN }}.exe"
echo "${{ env.COSIGN_PUBLIC_KEY }}" > RCM.pub
env:
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PUBLIC_KEY: ${{ secrets.COSIGN_PUBLIC_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
FILE2SIGN: "RCM"
- name: (GHO) Upload exe
uses: actions/[email protected]
with:
name: RCM-client-${{ runner.os }}-turbovnc-${{ matrix.turbovnc-version }}
path: |
RCM.exe
RCM.sig
RCM.pub
- name: (GHO) Upload dir
uses: actions/[email protected]
with:
name: RCM-client-${{ runner.os }}-turbovnc-${{ matrix.turbovnc-version }}-dir
path: |
RCM-dir