Skip to content

Commit

Permalink
fix: use manylinux to build standalone binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
agateau-gg committed Oct 25, 2024
1 parent 77fa6a9 commit 33875ff
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions .github/workflows/build_release_assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
build_os_packages:
name: Build packages
runs-on: ${{ matrix.os }}
container: ${{ matrix.os == 'ubuntu-22.04' && 'quay.io/pypa/manylinux_2_28_x86_64' || null }}
strategy:
fail-fast: false
matrix:
Expand All @@ -64,12 +65,25 @@ jobs:
# Get enough commits to run `ggshield secret scan commit-range` on ourselves
fetch-depth: 10

- name: Set up Python 3.10
- name: Set up Python 3.10 (Windows 1)
uses: actions/setup-python@v5
if: "!startsWith(matrix.os, 'macos-')"
if: matrix.os == 'windows-2022'
with:
python-version: '3.10'

- name: Set up Python 3.10 (Windows 2)
uses: actions/setup-python@v5
if: matrix.os == 'windows-2022'
run: |
echo PYTHON_CMD=python >> $GITHUB_ENV
- name: Set up Python 3.10 (Linux)
if: matrix.os == 'ubuntu-22.04'
# Make `python` points to python 3.10
run: |
ln -s $(which python3.10) /usr/local/bin/python
echo PYTHON_CMD=/usr/local/bin/python >> $GITHUB_ENV
- name: Install macOS specific dependencies
if: startsWith(matrix.os, 'macos-')
run: |
Expand All @@ -92,6 +106,7 @@ jobs:
# Make Python available
echo PATH=$PWD/python/bin:$PATH >> $GITHUB_ENV
echo PYTHON_CMD=$PWD/python/bin/python >> $GITHUB_ENV
# Install rcodesign
RCODESIGN_VERSION=0.27.0
Expand All @@ -109,10 +124,11 @@ jobs:
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade \
pipx install \
--python "$PYTHON_CMD" \
pipenv==2023.12.1 \
pyinstaller==6.7.0
pipenv install --system --dev
env:
# Disable lock otherwise Windows-only dependencies like colorama are not installed
Expand All @@ -121,15 +137,20 @@ jobs:
- name: Install Linux specific dependencies
if: matrix.os == 'ubuntu-22.04'
run: |
# Install NFPM
NFPM_VERSION=2.36.1
NFPM_CHECKSUM=05c17a1e09c470807b149fdd7bcd8f600eea044f459fc3ce81aa230103c0baf5
NFPM_CHECKSUM=9f8effa24bc6033b509611dbe68839542a63e825525b195672298c369051ef0b
scripts/download \
https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_amd64.deb \
nfpm.deb \
https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_Linux_x86_64.tar.gz \
nfpm.tar.gz \
$NFPM_CHECKSUM
sudo dpkg -i nfpm.deb
tar xf nfpm.tar.gz nfpm
cp nfpm /usr/local/bin
# Avoid "dubious permission" git error
git config --global --add safe.directory '*'
- name: Prepare macOS secrets
if: startsWith(matrix.os, 'macos-') && inputs.release_mode
Expand Down

0 comments on commit 33875ff

Please sign in to comment.