Skip to content

Commit fea910d

Browse files
fix: allow to reuse last release binaries (if requested) (#1174)
Co-authored-by: pyansys-ci-bot <pyansys.github.bot@ansys.com>
1 parent 59b9099 commit fea910d

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

.github/workflows/ci_cd.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,8 @@ jobs:
507507
runs-on:
508508
group: ansys-network
509509
labels: [self-hosted, Windows, signtool]
510+
env:
511+
REUSE_LAST_ARTIFACTS: ${{ vars.REUSE_LAST_ARTIFACTS == 1 }}
510512

511513
steps:
512514
- name: Check out repository pyansys-geometry-binaries
@@ -515,11 +517,28 @@ jobs:
515517
repository: 'ansys/pyansys-geometry-binaries'
516518
token: ${{ secrets.BINARIES_TOKEN }}
517519

518-
- name: Download binaries
520+
- name: Download binaries (if conditions met)
521+
if: env.REUSE_LAST_ARTIFACTS == 'false'
519522
run: |
520523
curl.exe -X GET -H "X-JFrog-Art-Api: ${{ secrets.ARTIFACTORY_KEY }}" ${{ secrets.ARTIFACTORY_URL }}/${{ env.ARTIFACTORY_VERSION }}/DockerWindows.zip --output windows-binaries.zip
521524
curl.exe -X GET -H "X-JFrog-Art-Api: ${{ secrets.ARTIFACTORY_KEY }}" ${{ secrets.ARTIFACTORY_URL }}/${{ env.ARTIFACTORY_VERSION }}/DockerLinux.zip --output linux-binaries.zip
522525
526+
- name: Reuse last binaries (if conditions met)
527+
if: env.REUSE_LAST_ARTIFACTS == 'true'
528+
env:
529+
VERSION_WITH_PREFIX: ${{ github.ref_name }}
530+
run: |
531+
# We are on a Windows machine. We need to copy the binaries from the previous tag,
532+
# based on the current tag. We will also remove the trailing "v" from the tag. This will give
533+
# us the folder from where we need to copy the binaries.
534+
$env:VERSION=$env:VERSION_WITH_PREFIX.substring(1)
535+
$env:PREVIOUS_VERSION=$env:VERSION.substring(0, $env:VERSION.Length - 1)
536+
$env:PREVIOUS_PATCH_VERSION_NUMBER=$env:VERSION.substring($env:VERSION.Length - 1)
537+
$env:PREVIOUS_PATCH_VERSION_NUMBER=[int]$env:PREVIOUS_PATCH_VERSION_NUMBER - 1
538+
$env:PREVIOUS_VERSION=$env:PREVIOUS_VERSION + $env:PREVIOUS_PATCH_VERSION_NUMBER
539+
cp ./$env:PREVIOUS_VERSION/windows-binaries.zip windows-binaries.zip
540+
cp ./$env:PREVIOUS_VERSION/linux-binaries.zip linux-binaries.zip
541+
523542
- name: Upload Windows binaries as workflow artifacts
524543
uses: actions/upload-artifact@v4
525544
with:

doc/changelog.d/1174.changed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fix: allow to reuse last release binaries (if requested)

src/ansys/geometry/core/connection/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def backend_version(self) -> semver.Version:
223223
224224
Returns
225225
-------
226-
semver.Version
226+
~semver.Version
227227
Backend version.
228228
"""
229229
return self._backend_version

0 commit comments

Comments
 (0)