diff --git a/.github/actions/build-and-publish/action.yaml b/.github/actions/build-and-publish/action.yaml index f3fb87297..cda6206da 100644 --- a/.github/actions/build-and-publish/action.yaml +++ b/.github/actions/build-and-publish/action.yaml @@ -2,6 +2,9 @@ name: Build and Publish author: Erwan Guyader description: Builds Cozy Desktop binaries and publish them to the latest Github release draft. inputs: + runner-os: + description: 'OS on which the action is being run.' + required: true gh-token: description: 'The Github token used to attach binaries to releases.' required: true @@ -20,22 +23,22 @@ inputs: runs: using: composite steps: - - name: Install dependencies - if: ${{ runner.os == "Linux" }} - shell: bash - run: | - # Install build dependencies: - # - `libopenjp2-tools` for the basic build - # - the others for cross-compiling 32 bit apps on a 64 bit machine - sudo apt update - sudo apt install --no-install-recommends -y libopenjp2-tools gcc-multilib g++-multilib + - name: Install dependencies + if: ${{ inputs.runner-os == 'Linux' }} + shell: bash + run: | + # Install build dependencies: + # - `libopenjp2-tools` for the basic build + # - the others for cross-compiling 32 bit apps on a 64 bit machine + sudo apt update + sudo apt install --no-install-recommends -y libopenjp2-tools gcc-multilib g++-multilib - - name: Setup python - if: ${{ runner.os == "macOS" }} - uses: actions/setup-python@v4 - with: - python-version: '2.x' # TODO: remove once electron-builder is updated to v23.0.2+ - cache: true + - name: Setup python + if: ${{ inputs.runner-os == 'macOS' }} + uses: actions/setup-python@v4 + with: + # TODO: remove once electron-builder is updated to v23.0.2+ + python-version: '2.x' - shell: bash env: @@ -46,8 +49,7 @@ runs: APPLE_ID: "${{ inputs.apple-id }}" APPLE_ID_PASSWORD: "${{ inputs.apple-id-password }}" run: | - echo "Where is python?" - which python - ls /usr/bin | grep "python" - python --version + echo "Moving installed python binary to the path where electron builder expects it..." + sudo mv $(which python) python + yarn dist diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index 6a731be37..e4f3368a0 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -211,6 +211,7 @@ jobs: - name: Build packages uses: ./.github/actions/build-and-publish with: + runner-os: "${{ runner.os }}" gh-token: "${{ secrets.GITHUB_TOKEN }}" - name: Save artifacts if: ${{ github.event_name == 'pull_request' }} diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index 8ccffc43d..d06390ae5 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -252,6 +252,7 @@ jobs: - name: Build package uses: ./.github/actions/build-and-publish with: + runner-os: "${{ runner.os }}" gh-token: "${{ secrets.github_token }}" mac-cert: "${{ secrets.mac_cert }}" mac-cert-password: "${{ secrets.mac_cert_password }}"