|
| 1 | +name: Package kDrive desktop on all platforms |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 'RELEASE-**' |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: packaging |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +env: |
| 14 | + KDRIVE_TOKEN: ${{ secrets.KDRIVE_TOKEN }} |
| 15 | + KDRIVE_ID: ${{ secrets.KDRIVE_ID }} |
| 16 | + KDRIVE_DIR_ID: ${{ secrets.KDRIVE_DIR_ID }} |
| 17 | + ALTOOL_USERNAME: ${{ secrets.ALTOOL_USERNAME }} |
| 18 | + |
| 19 | +jobs: |
| 20 | + package-Windows: |
| 21 | + runs-on: [ self-hosted, Windows, desktop-kDrive ] |
| 22 | + env: |
| 23 | + BRANCH_NAME: ${{ github.ref_name || inputs.BRANCH }} |
| 24 | + steps: |
| 25 | + - name: Checkout the PR |
| 26 | + |
| 27 | + with: |
| 28 | + ref: ${{ env.BRANCH_NAME }} # actions/checkout might not access wildcards, this needs to be tested by having the workflow in a RELEASE branch. |
| 29 | + submodules: recursive |
| 30 | + |
| 31 | + - name: Restore extension packages |
| 32 | + run : nuget restore extensions/windows/cfapi/kDriveExt.sln |
| 33 | + |
| 34 | + - name: Import Windows virtual certificate |
| 35 | + env: |
| 36 | + WINDOWS_VIRTUAL_CERT: ${{ secrets.WINDOWS_VIRTUAL_CERT }} |
| 37 | + WINDOWS_VIRTUAL_CERT_PASSWORD: ${{ secrets.WINDOWS_VIRTUAL_CERT_PASSWORD }} |
| 38 | + run: | |
| 39 | + New-Item -ItemType directory -Path certificate |
| 40 | + Set-Content -Path certificate/tempCert.txt -Value $env:WINDOWS_VIRTUAL_CERT |
| 41 | + certutil -decode certificate/tempCert.txt certificate/certificate.pfx |
| 42 | + Remove-Item -path certificate -include tempCert.txt |
| 43 | + Import-PfxCertificate -FilePath certificate/certificate.pfx -CertStoreLocation Cert:\CurrentUser\My -Password (ConvertTo-SecureString -String $env:WINDOWS_VIRTUAL_CERT_PASSWORD -Force -AsPlainText) |
| 44 | +
|
| 45 | + - name: Build and package kDrive desktop |
| 46 | + run: | |
| 47 | + call "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build/vcvars64.bat" |
| 48 | + powershell ./infomaniak-build-tools/windows/build-drive.ps1 |
| 49 | + shell: cmd |
| 50 | + |
| 51 | + - name: Upload to kDrive |
| 52 | + run: powershell ./infomaniak-build-tools/windows/upload-ci.ps1 |
| 53 | + |
| 54 | + - name: Clean-up generated code |
| 55 | + run : powershell ./infomaniak-build-tools/windows/build-drive.ps1 -clean all |
| 56 | + |
| 57 | + package-Linux: |
| 58 | + runs-on: [ self-hosted, Linux, X64, desktop-kdrive ] |
| 59 | + env: |
| 60 | + BRANCH_NAME: ${{ github.ref_name || inputs.BRANCH }} |
| 61 | + steps: |
| 62 | + - name: Checkout the PR |
| 63 | + |
| 64 | + with: |
| 65 | + ref: ${{ env.BRANCH_NAME }} |
| 66 | + submodules: recursive |
| 67 | + |
| 68 | + - name: Grant building script execute permission |
| 69 | + run : chmod +x ./infomaniak-build-tools/linux/build-ci-amd64.sh |
| 70 | + - name: Build kDrive desktop |
| 71 | + run : ./infomaniak-build-tools/linux/build-ci-amd64.sh release |
| 72 | + |
| 73 | + - name: Grant packaging script execute permission |
| 74 | + run : chmod +x ./infomaniak-build-tools/linux/package-ci-amd64.sh |
| 75 | + - name: Package kDrive desktop and upload to kDrive |
| 76 | + run : ./infomaniak-build-tools/linux/package-ci-amd64.sh |
| 77 | + |
| 78 | + - name: Clean-up generated code |
| 79 | + run : rm -rf build-linux |
| 80 | + |
| 81 | + package-MacOS: |
| 82 | + runs-on: [ self-hosted, macOS, desktop-kdrive ] |
| 83 | + env: |
| 84 | + BRANCH_NAME: ${{ github.ref_name || inputs.BRANCH }} |
| 85 | + steps: |
| 86 | + - name: Checkout the PR |
| 87 | + |
| 88 | + with: |
| 89 | + ref: ${{ env.BRANCH_NAME }} |
| 90 | + submodules: recursive |
| 91 | + |
| 92 | + - name: Unlock keychain to use the certificate |
| 93 | + run : security unlock-keychain -p '${{ secrets.KEYCHAIN_PASSWORD }}' login.keychain |
| 94 | + |
| 95 | + - name: Build and package kDrive desktop |
| 96 | + run : ./infomaniak-build-tools/macos/build-drive.sh |
| 97 | + |
| 98 | + - name: Grant upload script execute permission |
| 99 | + run : chmod +x ./infomaniak-build-tools/macos/upload-ci.sh |
| 100 | + - name: Upload to kDrive |
| 101 | + run : ./infomaniak-build-tools/macos/upload-ci.sh |
| 102 | + |
| 103 | + - name: Clean-up generated code |
| 104 | + run : rm -rf build-macos |
0 commit comments