Skip to content

Commit 3ff3b7c

Browse files
committed
fix: use manylinux to build standalone binaries
1 parent 77fa6a9 commit 3ff3b7c

File tree

1 file changed

+33
-13
lines changed

1 file changed

+33
-13
lines changed

.github/workflows/build_release_assets.yml

+33-13
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
build_os_packages:
4343
name: Build packages
4444
runs-on: ${{ matrix.os }}
45+
container: ${{ matrix.os == 'ubuntu-22.04' && 'quay.io/pypa/manylinux_2_28_x86_64' || null }}
4546
strategy:
4647
fail-fast: false
4748
matrix:
@@ -64,12 +65,24 @@ jobs:
6465
# Get enough commits to run `ggshield secret scan commit-range` on ourselves
6566
fetch-depth: 10
6667

67-
- name: Set up Python 3.10
68+
- name: Set up Python 3.10 (Windows 1/2)
69+
if: matrix.os == 'windows-2022'
6870
uses: actions/setup-python@v5
69-
if: "!startsWith(matrix.os, 'macos-')"
7071
with:
7172
python-version: '3.10'
7273

74+
- name: Set up Python 3.10 (Windows 2/2)
75+
if: matrix.os == 'windows-2022'
76+
run: |
77+
echo PYTHON_CMD=python >> $GITHUB_ENV
78+
79+
- name: Set up Python 3.10 (Linux)
80+
if: matrix.os == 'ubuntu-22.04'
81+
# Make `python` points to python 3.10
82+
run: |
83+
ln -s $(which python3.10) /usr/local/bin/python
84+
echo PYTHON_CMD=/usr/local/bin/python >> $GITHUB_ENV
85+
7386
- name: Install macOS specific dependencies
7487
if: startsWith(matrix.os, 'macos-')
7588
run: |
@@ -92,6 +105,7 @@ jobs:
92105
93106
# Make Python available
94107
echo PATH=$PWD/python/bin:$PATH >> $GITHUB_ENV
108+
echo PYTHON_CMD=$PWD/python/bin/python >> $GITHUB_ENV
95109
96110
# Install rcodesign
97111
RCODESIGN_VERSION=0.27.0
@@ -109,27 +123,33 @@ jobs:
109123
- name: Install dependencies
110124
shell: bash
111125
run: |
112-
python -m pip install --upgrade pip
113-
python -m pip install --upgrade \
114-
pipenv==2023.12.1 \
115-
pyinstaller==6.7.0
116-
pipenv install --system --dev
126+
pipx install \
127+
--python "$PYTHON_CMD" \
128+
pipenv==2023.12.1
129+
130+
pipenv install --dev
131+
pipenv run pip install pyinstaller==6.7.0
117132
env:
118133
# Disable lock otherwise Windows-only dependencies like colorama are not installed
119134
PIPENV_SKIP_LOCK: 1
120135

121136
- name: Install Linux specific dependencies
122137
if: matrix.os == 'ubuntu-22.04'
123138
run: |
139+
# Install NFPM
124140
NFPM_VERSION=2.36.1
125-
NFPM_CHECKSUM=05c17a1e09c470807b149fdd7bcd8f600eea044f459fc3ce81aa230103c0baf5
141+
NFPM_CHECKSUM=9f8effa24bc6033b509611dbe68839542a63e825525b195672298c369051ef0b
126142
127143
scripts/download \
128-
https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_amd64.deb \
129-
nfpm.deb \
144+
https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_Linux_x86_64.tar.gz \
145+
nfpm.tar.gz \
130146
$NFPM_CHECKSUM
131147
132-
sudo dpkg -i nfpm.deb
148+
tar xf nfpm.tar.gz nfpm
149+
cp nfpm /usr/local/bin
150+
151+
# Avoid "dubious permission" git error
152+
git config --global --add safe.directory '*'
133153
134154
- name: Prepare macOS secrets
135155
if: startsWith(matrix.os, 'macos-') && inputs.release_mode
@@ -199,7 +219,7 @@ jobs:
199219
else
200220
args="--git-version"
201221
fi
202-
scripts/build-os-packages/build-os-packages $args
222+
pipenv run scripts/build-os-packages/build-os-packages $args
203223
204224
- name: Override base Docker image used for functional tests on Windows
205225
if: matrix.os == 'windows-2022'
@@ -214,7 +234,7 @@ jobs:
214234
# See note about steps requiring the GITGUARDIAN_API at the top of this file
215235
if: ${{ !github.event.pull_request.head.repo.fork }}
216236
run: |
217-
scripts/build-os-packages/build-os-packages functests
237+
pipenv run scripts/build-os-packages/build-os-packages functests
218238
env:
219239
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
220240
GITGUARDIAN_API_URL: ${{ secrets.GITGUARDIAN_API_URL }}

0 commit comments

Comments
 (0)