3131 - ubuntu-20.04
3232 turbovnc-version :
3333 - " 3.1"
34- - " 2.2.7"
34+ # - "2.2.7"
3535 include :
3636 - os : macos-13
3737 turbovnc-version : " none"
4242 runs-on : ${{ matrix.os }}
4343 permissions :
4444 attestations : write
45- contents : read
45+ contents : write
4646 id-token : write
4747
4848 # Steps represent a sequence of tasks that will be executed as part of the job
@@ -76,48 +76,72 @@ jobs:
7676 }
7777 echo "EXT=.exe" >> "${env:GITHUB_ENV}"
7878
79- - name : Define artifact basename
79+ # ======================================================================
80+ # CI VARIABLES
81+ # ======================================================================
82+ - name : Define platform
8083 uses : carlkidcrypto/os-specific-runner@v2.0.0
8184 env :
8285 RUNNER_ARCH : ${{ runner.arch }}
8386 with :
8487 macos : |
8588 runner_arch=$(echo "${RUNNER_ARCH}" | tr '[:upper:]' '[:lower:]')
86- echo "ARTIFACT_BASENAME=RCM-client_${{ matrix.os }}_${runner_arch}" >> "${GITHUB_ENV}"
87- linux : echo "ARTIFACT_BASENAME=RCM-client_${{ matrix.os }}_${RUNNER_ARCH,,}_turbovnc_${{ matrix.turbovnc-version }}" >> "${GITHUB_ENV}"
89+ echo "ARTIFACT_PLATFORM=${{ matrix.os }}_${runner_arch}" >> "${GITHUB_ENV}"
90+ linux : |
91+ echo "ARTIFACT_PLATFORM=${{ matrix.os }}_${RUNNER_ARCH,,}" >> "${GITHUB_ENV}"
8892 windows : |
8993 $runner_arch=${env:RUNNER_ARCH}.toLower()
90- echo "ARTIFACT_BASENAME=RCM-client_${{ matrix.os }}_${runner_arch}_turbovnc_${{ matrix.turbovnc-version }}" >> "${env:GITHUB_ENV}"
94+ echo "ARTIFACT_PLATFORM=${{ matrix.os }}_${runner_arch}" >> "${env:GITHUB_ENV}"
95+
96+ - name : Define artifact basename
97+ shell : bash
98+ run : echo "ARTIFACT_BASENAME=RCM-client--${{ env.ARTIFACT_PLATFORM }}" >> "${GITHUB_ENV}"
99+
100+ - name : Define artifact version for tag
101+ if : ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
102+ shell : bash
103+ run : echo "ARTIFACT_VERSION=${{ github.ref_name }}" >> "${GITHUB_ENV}"
104+
105+ - name : Define artifact version for normal commit
106+ if : ${{ github.event_name != 'push' && !contains(github.ref, 'refs/tags/') }}
107+ shell : bash
108+ run : echo "ARTIFACT_VERSION=${{ github.sha }}" >> "${GITHUB_ENV}"
91109
110+ # ======================================================================
92111 # CACHE
112+ # ======================================================================
93113 - name : (GHO) Cache pyenv
94114 uses : actions/cache@v4.0.0
95115 id : cache-pyenv
96116 with :
97117 path : .pyenv
98- key : pyenv-${{ env.PYENV_VERSION }}-python-${{ env.PYTHON_VERSION }}-${{ matrix.os }}
118+ key : pyenv-${{ env.PYENV_VERSION }}-python-${{ env.PYTHON_VERSION }}-${{ matrix.os }}-${{ hashFiles('scripts/ci/02-install-python.*') }}
99119
100120 - name : (GHO) Cache venv
101121 uses : actions/cache@v4.0.0
102122 id : cache-venv
103123 with :
104124 path : .venv
105- key : venv-python-${{ env.PYTHON_VERSION }}-${{ hashFiles( format('{0}/rcm/client/requirements.txt', env.RCM_CHECKOUT ) ) }}-paramiko- ${{ env.PARAMIKO_PULL }}-${{env.PARAMIKO_COMMIT }}-${{ matrix.os }}
125+ key : venv-python-${{ env.PYTHON_VERSION }}-paramiko- ${{ env.PARAMIKO_PULL }}-${{env.PARAMIKO_COMMIT }}-${{ matrix.os }}-${{ hashFiles('scripts/ci/03-install-venv.*', '**/requirements.txt') }}
106126
107127 - name : (GHO) Cache turbovnc
108128 uses : actions/cache@v4.0.0
109129 id : cache-turbovnc
110130 with :
111131 path : ${{ env.RCM_CHECKOUT }}/${{ env.TURBOVNC_EXTERNAL }}
112- key : turbovnc-${{ matrix.turbovnc-version }}-${{ matrix.os }}
132+ key : turbovnc-${{ matrix.turbovnc-version }}-${{ matrix.os }}-${{ hashFiles('scripts/ci/04*') }}
113133
114134 - name : (GHO) Cache step
115135 uses : actions/cache@v4.0.0
116136 id : cache-step
117137 with :
118- path : ${{ env.RCM_CHECKOUT }}/${{ env.SMALLSTEP_EXTERNAL }}
138+ path : ${{ env.RCM_CHECKOUT }}/${{ env.SMALLSTEP_EXTERNAL }}-${{ hashFiles('scripts/ci/05*') }}
119139 key : step-${{ matrix.os }}
120140
141+ # ======================================================================
142+ # CI STEPS
143+ # ======================================================================
144+
121145 # PYTHON
122146 - name : Setup pyenv environment
123147 uses : carlkidcrypto/os-specific-runner@v2.0.0
@@ -171,21 +195,31 @@ jobs:
171195 linux : . "${RCM_CHECKOUT}/scripts/ci/05-extract-step-linux.sh"
172196 windows : . "${env:RCM_CHECKOUT}\scripts\ci\05-extract-step.ps1"
173197
198+ # EXTERNAL PLINK
199+ - name : External plink (windows)
200+ uses : carlkidcrypto/os-specific-runner@v2.0.0
201+ with :
202+ windows : . "${env:RCM_CHECKOUT}\scripts\ci\06-download-plink.ps1"
203+
204+ # ======================================================================
174205 # PYINSTALLER
206+ # ======================================================================
175207 - name : Build pyinstaller
176208 uses : carlkidcrypto/os-specific-runner@v2.0.0
177209 with :
178210 macos : |
179211 source .venv/bin/activate
180- pyinstaller "${RCM_CHECKOUT}/rcm/client/rcm_client_qt.spec"
212+ pyinstaller "${RCM_CHECKOUT}/rcm/client/rcm_client_qt.spec" -- ${{ env.ARTIFACT_VERSION }} ${{ env.ARTIFACT_PLATFORM }}
181213 linux : |
182214 source .venv/bin/activate
183- pyinstaller "${RCM_CHECKOUT}/rcm/client/rcm_client_qt.spec"
215+ pyinstaller "${RCM_CHECKOUT}/rcm/client/rcm_client_qt.spec" -- ${{ env.ARTIFACT_VERSION }} ${{ env.ARTIFACT_PLATFORM }}
184216 windows : |
185217 .venv\Scripts\Activate.ps1
186- pyinstaller "${env:RCM_CHECKOUT}\rcm\client\rcm_client_qt.spec"
218+ pyinstaller "${env:RCM_CHECKOUT}\rcm\client\rcm_client_qt.spec" -- ${{ env.ARTIFACT_VERSION }} ${{ env.ARTIFACT_PLATFORM }}
187219
188- # ARTIFACT
220+ # ======================================================================
221+ # ARTIFACTS AND RELESES
222+ # ======================================================================
189223 - name : (GHO) Move preartifacts
190224 shell : bash
191225 run : |
@@ -194,42 +228,55 @@ jobs:
194228 find dist -type f -name "RCM${{ env.EXT }}" -exec cp '{}' . \;
195229 find dist -type f -name "RCM.zip" -exec cp '{}' . \;
196230
197- - name : (Attestation) Attest RCM executable
198- uses : actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3
199- with :
200- subject-path : RCM${{ env.EXT }}
201- subject-name : ${{ env.ARTIFACT_BASENAME }}
202-
203- - name : (Attestation) Attest RCM zip
204- uses : actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3
231+ # TAG RELEASE
232+ - name : (GHO)(TAG) Upload exe to release
233+ if : ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
234+ uses : svenstaro/upload-release-action@v2
205235 with :
206- subject-path : RCM.zip
207- subject-name : ${{ env.ARTIFACT_BASENAME }}-dir
236+ file : RCM${{ env.EXT }}
237+ asset_name : ${{ env.ARTIFACT_BASENAME }}--${{ env.ARTIFACT_VERSION }}${{ env.EXT }}
238+ prerelease : true
239+ overwrite : true
240+ tag : ${{ github.ref }}
208241
209242 - name : (GHO)(TAG) Upload exe to release
210243 if : ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
211244 uses : svenstaro/upload-release-action@v2
212245 with :
213- file : RCM${{ env.EXT }}
214- asset_name : ${{ env.ARTIFACT_BASENAME }}${{ env.EXT }}
246+ file : RCM.zip
247+ asset_name : ${{ env.ARTIFACT_BASENAME }}-- ${{ env.ARTIFACT_VERSION }}.zip
215248 prerelease : true
216249 overwrite : true
217250 tag : ${{ github.ref }}
218251
252+ # CI ARTIFACT
219253 - name : (GHO) Upload artifact exe
220254 if : ${{ github.event_name != 'push' && !contains(github.ref, 'refs/tags/') }}
221255 uses : actions/upload-artifact@v4.3.1
222256 with :
223- name : ${{ env.ARTIFACT_BASENAME }}
257+ name : ${{ env.ARTIFACT_BASENAME }}--${{ env.ARTIFACT_VERSION }}
224258 path : RCM${{ env.EXT }}
225259
226260 - name : (GHO) Upload artifact dir
227261 if : ${{ github.event_name != 'push' && !contains(github.ref, 'refs/tags/') }}
228262 uses : actions/upload-artifact@v4.3.1
229263 with :
230- name : ${{ env.ARTIFACT_BASENAME }}-dir
264+ name : ${{ env.ARTIFACT_BASENAME }}--${{ env.ARTIFACT_VERSION }}- dir
231265 path : RCM.zip
232266
267+ # ATTESTATION
268+ - name : (Attestation) Attest RCM executable
269+ uses : actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3
270+ with :
271+ subject-path : RCM${{ env.EXT }}
272+ subject-name : ${{ env.ARTIFACT_BASENAME }}--${{ env.ARTIFACT_VERSION }}
273+
274+ - name : (Attestation) Attest RCM zip
275+ uses : actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3
276+ with :
277+ subject-path : RCM.zip
278+ subject-name : ${{ env.ARTIFACT_BASENAME }}--${{ env.ARTIFACT_VERSION }}-dir
279+
233280 - name : (Attestation) Verify RCM executable and zip
234281 shell : bash
235282 env :
0 commit comments