Skip to content

Bump the github-workflows group across 1 directory with 4 updates #159

Bump the github-workflows group across 1 directory with 4 updates

Bump the github-workflows group across 1 directory with 4 updates #159

Workflow file for this run

name: Package client
on:
pull_request:
paths:
- .github/workflows/package-client.yml
- client/electron/package.js
- client/electron/snap
workflow_call:
inputs:
version:
description: The version to use
type: string
required: true
version_patch_run_id:
description: |
The run id where the version.patch artifact was uploaded.
If not provided, the workflow will generate the patch by itself.
type: string
required: true
commit_sha:
required: true
type: string
description: The commit SHA to use when checkout'ing the repository
default: ${{ github.sha }}
workflow_dispatch:
inputs:
version:
description: The version to use (if not provided, will generate one from code space version)
type: string
required: false
# Set `concurrency` to prevent this workflow from being run on code that is not up-to-date on a PR (e.g. when making many push quickly on a PR).
# This behavior is only intended for a PR and not for merge commits on the main branch. Having the workflow run on each merge commit can be useful to spot regressions missed by previous checks.
# To distinguish between these cases, we use `head_ref` that is only defined on `pull-request` and fallback to `run_id` (this is a counter, so it's value is unique between workflow call).
concurrency:
group: package-client-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
# We use the version 18.12 because the version >= 18.13 have some breaking changes on how they format the date.
# That would break our unit test if we don't update them.
node-version: 18.12.0
wasm-pack-version: 0.11.0
WINFSP_VERSION: 2.0.23075
permissions:
contents: read
jobs:
version:
if: ${{ inputs.version_patch_run_id == '' }}
uses: ./.github/workflows/_parse_version.yml
with:
version: ${{ inputs.version }}
commit_sha: ${{ inputs.commit_sha }}
webapp:
needs: version
# Always run the job if `version` job is skipped otherwise only if `version` job was successful.
if: ${{ inputs.version_patch_run_id != '' && always() || success() }}
runs-on: ubuntu-22.04
name: ⚡ Package web app
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # pin v4.1.5
with:
ref: ${{ inputs.commit_sha }}
timeout-minutes: 5
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # pin v4.0.2
with:
node-version: ${{ env.node-version }}
timeout-minutes: 2
- name: Download version.patch artifact
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # pin v4.1.7
with:
name: version.patch
path: ${{ runner.temp }}/version.patch
run-id: ${{ inputs.version_patch_run_id || github.run_id }}
- name: Apply version.patch
run: git apply --allow-empty ${{ runner.temp }}/version.patch/version.patch
- name: Install dependencies
run: npm clean-install
working-directory: client
# Install syft
- uses: taiki-e/install-action@c2927f0c5b5adc6a76bc4a7847bc6e0503754bed # pin v2.33.22
with:
tool: [email protected], wasm-pack@${{ env.wasm-pack-version }}
- name: Build web bindings
run: npm run build:release
working-directory: bindings/web
- name: Build web app
run: npm run web:release
working-directory: client
- name: Generate SBOM
run: syft packages --config=.syft.yaml --output=spdx-json=client/dist/Parsec-SBOM-Web.spdx.json .
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # pin v4.3.3
with:
name: webapp
path: client/dist/
if-no-files-found: error
electron-snap:
needs: version
runs-on: ubuntu-22.04
# Always run the job if `version` job is skipped otherwise only if `version` job was successful.
if: ${{ inputs.version_patch_run_id != '' && always() || success() }}
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # pin v4.1.5
with:
ref: ${{ inputs.commit_sha }}
timeout-minutes: 5
- name: Download version.patch artifact
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # pin v4.1.7
with:
name: version.patch
path: ${{ runner.temp }}/version.patch
run-id: ${{ inputs.version_patch_run_id || github.run_id }}
- name: Load version config
id: version
shell: bash
run: |
cat version.patch/version.ini > "$GITHUB_OUTPUT"
cat "$GITHUB_OUTPUT"
working-directory: ${{ runner.temp }}
- name: Apply version.patch
run: git apply --allow-empty ${{ runner.temp }}/version.patch/version.patch
- name: Install snapcraft
uses: samuelmeuli/action-snapcraft@d33c176a9b784876d966f80fb1b461808edc0641 # pin v2.1.1
timeout-minutes: 1
- name: Setup LXD
uses: canonical/setup-lxd@4e959f8e0d9c5feb27d44c5e4d9a330a782edee0 # pin v0.1.1
timeout-minutes: 2
- name: Patch cannot install cypress on lxd
run: npm remove cypress{,-file-upload,-real-events,-vite}
working-directory: client
timeout-minutes: 2
- name: Build snap
run: |
ln -sv client/electron/snap
snapcraft pack --use-lxd -v
timeout-minutes: 30
- name: Rename artifacts
shell: bash
run: |
ARCH=$(uname -m)
mv -v parsec-v3_*_*.snap Parsec-v3_${{ steps.version.outputs.full }}_linux_$ARCH.snap
# Install syft
- uses: taiki-e/install-action@c2927f0c5b5adc6a76bc4a7847bc6e0503754bed # pin v2.33.22
with:
tool: [email protected]
- name: Generate SBOM
run: syft packages --config=.syft.yaml --output=spdx-json=Parsec-SBOM-Electron-linux.spdx.json .
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # pin v4.3.3
with:
name: ${{ runner.os }}-${{ runner.arch }}-electron-app
path: |
Parsec-v3_${{ steps.version.outputs.full }}_linux_*.snap
Parsec-SBOM-Electron-linux.spdx.json
if-no-files-found: error
timeout-minutes: 10
electron-non-linux:
needs: version
# Always run the job if `version` job is skipped otherwise only if `version` job was successful.
if: ${{ inputs.version_patch_run_id != '' && always() || success() }}
strategy:
fail-fast: false
matrix:
include:
- name: 🏁 Windows
platform: windows
os: windows-2022
- name: 🍎 macOS
platform: macos
os: macos-12
name: "${{matrix.name }}: ⚡ Package electron"
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # pin v4.1.5
with:
ref: ${{ inputs.commit_sha }}
timeout-minutes: 5
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # pin v4.0.2
with:
node-version: ${{ env.node-version }}
timeout-minutes: 2
- name: Download version.patch artifact
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # pin v4.1.7
with:
name: version.patch
path: ${{ runner.temp }}/version.patch
run-id: ${{ inputs.version_patch_run_id || github.run_id }}
- name: Load version config
id: version
shell: bash
run: |
cat version.patch/version.ini > "$GITHUB_OUTPUT"
cat "$GITHUB_OUTPUT"
working-directory: ${{ runner.temp }}
- name: Apply version.patch
run: git apply --allow-empty ${{ runner.temp }}/version.patch/version.patch
- name: Windows > Install WinFSP
if: matrix.platform == 'windows'
shell: bash
run: |
set -eux
choco install winfsp -y --version=${{ env.WINFSP_VERSION }}
curl -L https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-tests-${{ env.WINFSP_VERSION }}.zip -o D:/a/_temp/winfsp-tests.zip
unzip D:/a/_temp/winfsp-tests.zip -d D:/a/_temp/
mv 'D:/a/_temp/winfsp-tests-x64.exe' 'C:/Program Files (x86)/WinFsp/bin/'
timeout-minutes: 2
- name: Install dependencies
shell: bash
run: |
npm clean-install
(cd electron && npm clean-install)
(cd ../bindings/electron && npm clean-install)
working-directory: client
timeout-minutes: 10
- name: Build Electron bindings
run: npm run build:release
working-directory: bindings/electron
# MacOS is really slow when build rust
timeout-minutes: 30
- name: Build Electron apps
run: npm run electron:release
working-directory: client
timeout-minutes: 5
# Install syft
- uses: taiki-e/install-action@c2927f0c5b5adc6a76bc4a7847bc6e0503754bed # pin v2.33.22
with:
tool: [email protected]
- name: Generate SBOM
run: syft packages --config=.syft.yaml --output=spdx-json=client/electron/dist/Parsec-SBOM-Electron-${{ matrix.platform }}.spdx.json .
- name: Windows > rename artifacts
if: matrix.platform == 'windows'
shell: bash
run: |
ARCH=$(uname -m)
mv -v 'parsec-v3 Setup '*.exe Parsec-v3_${{ steps.version.outputs.full }}_win_$ARCH.exe
mv -v 'parsec-v3 Setup '*.exe.blockmap Parsec-v3_${{ steps.version.outputs.full }}_win_$ARCH.exe.blockmap
working-directory: client/electron/dist
env:
BASH_XTRACEFD: 1
- name: MacOS > rename artifacts
if: matrix.platform == 'macos'
shell: bash
run: |
ARCH=$(uname -m)
mv -v parsec-v3-*.dmg Parsec-v3_${{ steps.version.outputs.full }}_macos_$ARCH.dmg
mv -v parsec-v3-*.dmg.blockmap Parsec-v3_${{ steps.version.outputs.full }}_macos_$ARCH.dmg.blockmap
working-directory: client/electron/dist
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # pin v4.3.3
with:
name: ${{ runner.os }}-${{ runner.arch }}-electron-app
path: |
client/electron/dist/Parsec-v3_${{ steps.version.outputs.full }}_*
client/electron/dist/Parsec-SBOM-Electron-${{ matrix.platform }}.spdx.json
if-no-files-found: error
timeout-minutes: 10