From 28818f747efdd6ef9be0405800d0af04fba86d6e Mon Sep 17 00:00:00 2001 From: Felipe Olmos <92923444+folmos-at-orange@users.noreply.github.com> Date: Mon, 19 Feb 2024 17:26:44 +0100 Subject: [PATCH] wip --- .github/workflows/pack-debian.yml | 38 ++++++++++++++++++++++------ .github/workflows/pack-nsis.yml | 41 ++++++++++++++++++++----------- 2 files changed, 57 insertions(+), 22 deletions(-) diff --git a/.github/workflows/pack-debian.yml b/.github/workflows/pack-debian.yml index 980f8ddaf..924bc1a15 100644 --- a/.github/workflows/pack-debian.yml +++ b/.github/workflows/pack-debian.yml @@ -1,11 +1,16 @@ --- -name: Create Debian package +name: Debian/Ubuntu Package on: workflow_dispatch: pull_request: - paths: ['**CMakeLists.txt', '**.cmake'] + paths: + - '**CMakeLists.txt' + - '**.cmake' + - .github/workflows/pack-debian.yml + push: + tags: [v*] jobs: - build-deb-package: + build: runs-on: ubuntu-latest defaults: run: @@ -50,8 +55,8 @@ jobs: # - the installation process (including dependencies installation) # - that executable works (run with -v) # - that it executes a small test - test-deb-package: - needs: build-deb-package + test: + needs: build runs-on: ubuntu-latest defaults: run: @@ -95,8 +100,8 @@ jobs: khiops_coclustering -v - name: Test Khiops installation uses: ./.github/actions/test-khiops-install - test-kni-deb: - needs: build-deb-package + test-kni: + needs: build runs-on: ubuntu-latest defaults: run: @@ -110,7 +115,7 @@ jobs: steps: - name: Put OS info on the environment run: | - source /etc/os-release + source /etc/os-release echo "ID=$ID" >> "$GITHUB_ENV" echo "VERSION_CODENAME=$VERSION_CODENAME" >> "$GITHUB_ENV" - name: Download artifacts @@ -129,3 +134,20 @@ jobs: sparse-checkout: .github - name: Test KNI package uses: ./.github/actions/test-kni + release: + needs: [build, test] # TODO: add kni + strategy: + matrix: + os: [debian10, ubuntu22.04, ubuntu20.04] + runs-on: ubuntu-latest + steps: + - name: Put OS info on the environment + run: | + source /etc/os-release + echo "ID=$ID" >> "$GITHUB_ENV" + echo "VERSION_CODENAME=$VERSION_CODENAME" >> "$GITHUB_ENV" + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: ${{ env.ID }}-${{ env.VERSION_CODENAME }} + diff --git a/.github/workflows/pack-nsis.yml b/.github/workflows/pack-nsis.yml index 48bb34b14..287944c2f 100644 --- a/.github/workflows/pack-nsis.yml +++ b/.github/workflows/pack-nsis.yml @@ -1,5 +1,5 @@ --- -name: Build NSIS Windows installer +name: Windows Installer on: workflow_dispatch: pull_request: @@ -7,13 +7,13 @@ on: - '**CMakeLists.txt' - packaging/windows/nsis/*.nsh - packaging/windows/nsis/*.nsi + - .github/workflows/pack-nsis.yml push: tags: [v*] jobs: - build-nsis-installer: + build: outputs: khiops-package-version: ${{ steps.get-version.outputs.khiops-package-version }} - name: Build NSIS Windows installer runs-on: windows-latest steps: - name: Obtain checkout ref @@ -30,7 +30,7 @@ jobs: echo "CHECKOUT_REF=$CHECKOUT_REF" >> $GITHUB_ENV echo "Checkout ref: $CHECKOUT_REF" - name: Checkout sources - uses: actions/checkout@v4.1.0 + uses: actions/checkout@v4 with: ref: ${{ env.CHECKOUT_REF }} - name: Put the package version on the environment and output @@ -44,7 +44,7 @@ jobs: echo "KHIOPS_PACKAGE_REDUCED_VERSION=$KHIOPS_PACKAGE_REDUCED_VERSION" >> "$GITHUB_ENV" echo "khiops-package-version=$KHIOPS_PACKAGE_VERSION" >> "$GITHUB_OUTPUT" - name: Download Windows install assets - uses: robinraju/release-downloader@v1.8 + uses: robinraju/release-downloader@v1.9 with: repository: khiopsml/khiops-win-install-assets latest: true @@ -78,19 +78,18 @@ jobs: /DKHIOPS_DOC_DIR=..\..\..\assets\doc ` khiops.nsi - name: Upload installer as an artifact - uses: actions/upload-artifact@v3.1.2 + uses: actions/upload-artifact@v3 with: - name: khiops-installer + name: khiops-installer-${{ env.KHIOPS_PACKAGE_VERSION }} path: ./packaging/windows/nsis/khiops-${{ env.KHIOPS_PACKAGE_VERSION }}-setup.exe - test-nsis-installer: - name: Test NSIS Windows installer - needs: build-nsis-installer + test: + needs: build runs-on: windows-2019 steps: - name: Download NSIS installer artifact - uses: actions/download-artifact@v3.0.2 + uses: actions/download-artifact@v3 with: - name: khiops-installer + name: khiops-installer-${{ needs.build.outputs.khiops-package-version }} - name: Install Khiops shell: pwsh run: | @@ -98,7 +97,7 @@ jobs: $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' Start-Process ` - -FilePath .\khiops-${{ needs.build-nsis-installer.outputs.khiops-package-version }}-setup.exe ` + -FilePath .\khiops-${{ needs.build.outputs.khiops-package-version }}-setup.exe ` -ArgumentList '/S' ` -Wait # Add Khiops and MPI to the path @@ -107,6 +106,20 @@ jobs: echo ${Env:GITHUB_ENV} type ${Env:GITHUB_ENV} - name: Checkout the khiops sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Test the installation uses: ./.github/actions/test-khiops-install + release: + if: github.ref_type == 'tag' + needs: [build, test] + runs-on: windows-2019 + steps: + - name: Download NSIS installer artifact + uses: actions/download-artifact@v3 + with: + name: khiops-installer-${{ needs.build.outputs.khiops-package-version }} + - name: Upload NSIS installer to a release + uses: ncipollo/release-action@v1.9 + with: + allowUpdates: true + artifacts: khiops-${{ needs.build.outputs.khiops-package-version }}-setup.exe