Skip to content

Commit

Permalink
fixup! Move python setup to build and publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
taratatach committed Dec 9, 2022
1 parent 1b9da11 commit 59ecabc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
41 changes: 22 additions & 19 deletions .github/actions/build-and-publish/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -46,8 +49,8 @@ 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..."
echo "PYTHON_PATH: `$PYTHON_PATH`"
PYTHON_PATH=$(which python)
yarn dist
1 change: 1 addition & 0 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down

0 comments on commit 59ecabc

Please sign in to comment.