|
| 1 | +name: Build CLI Installer Artifacts Partial |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + retention-days: |
| 7 | + description: 'Number of days to retain uploaded artifacts' |
| 8 | + type: number |
| 9 | + default: 7 |
| 10 | + |
| 11 | +jobs: |
| 12 | + package-installers: |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + include: |
| 17 | + - os: macos-latest |
| 18 | + command: pack macos |
| 19 | + artifact_name: macos-pkg |
| 20 | + artifact_path: cli/dist/**/*.pkg |
| 21 | + - os: windows-latest |
| 22 | + command: pack win --targets win32-x64 |
| 23 | + artifact_name: windows-installer |
| 24 | + artifact_path: cli/dist/**/*.exe |
| 25 | + - os: ubuntu-latest |
| 26 | + command: pack deb |
| 27 | + artifact_name: linux-deb |
| 28 | + artifact_path: cli/dist/**/*.deb |
| 29 | + runs-on: ${{ matrix.os }} |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v4 |
| 32 | + - uses: pnpm/action-setup@v4 |
| 33 | + - uses: actions/setup-node@v4 |
| 34 | + with: |
| 35 | + node-version-file: '.nvmrc' |
| 36 | + cache: 'pnpm' |
| 37 | + - name: Configure pnpm linker for Windows packaging |
| 38 | + if: ${{ matrix.os == 'windows-latest' }} |
| 39 | + shell: pwsh |
| 40 | + run: Set-Content -Path cli/.npmrc -Value "node-linker=hoisted" |
| 41 | + - run: pnpm install --frozen-lockfile |
| 42 | + - run: pnpm run build |
| 43 | + - name: Install Windows packaging dependencies |
| 44 | + if: ${{ matrix.os == 'windows-latest' }} |
| 45 | + run: choco install nsis.portable 7zip grep --no-progress -y |
| 46 | + - name: Verify Windows packaging dependencies |
| 47 | + if: ${{ matrix.os == 'windows-latest' }} |
| 48 | + shell: pwsh |
| 49 | + run: | |
| 50 | + where.exe makensis |
| 51 | + where.exe 7z |
| 52 | + where.exe grep |
| 53 | + - name: Build installer |
| 54 | + run: pnpm -C cli exec oclif ${{ matrix.command }} |
| 55 | + - name: Upload installer artifact |
| 56 | + uses: actions/upload-artifact@v4 |
| 57 | + with: |
| 58 | + name: ${{ matrix.artifact_name }} |
| 59 | + path: ${{ matrix.artifact_path }} |
| 60 | + retention-days: ${{ inputs.retention-days }} |
| 61 | + |
| 62 | + package-tarballs: |
| 63 | + runs-on: ubuntu-latest |
| 64 | + steps: |
| 65 | + - uses: actions/checkout@v4 |
| 66 | + - uses: pnpm/action-setup@v4 |
| 67 | + - uses: actions/setup-node@v4 |
| 68 | + with: |
| 69 | + node-version-file: '.nvmrc' |
| 70 | + cache: 'pnpm' |
| 71 | + - run: pnpm install --frozen-lockfile |
| 72 | + - run: pnpm run build |
| 73 | + - name: Install 7-zip for packaging |
| 74 | + run: | |
| 75 | + sudo apt-get update |
| 76 | + sudo apt-get install -y p7zip-full |
| 77 | + - name: Build tarballs |
| 78 | + run: pnpm -C cli exec oclif pack tarballs |
| 79 | + - name: Upload tarball artifacts |
| 80 | + uses: actions/upload-artifact@v4 |
| 81 | + with: |
| 82 | + name: tarballs |
| 83 | + path: | |
| 84 | + cli/dist/**/*.tar.gz |
| 85 | + cli/dist/**/*.tar.xz |
| 86 | + retention-days: ${{ inputs.retention-days }} |
0 commit comments