42
42
build_os_packages :
43
43
name : Build packages
44
44
runs-on : ${{ matrix.os }}
45
+ container : ${{ matrix.os == 'ubuntu-22.04' && 'quay.io/pypa/manylinux_2_28_x86_64' || null }}
45
46
strategy :
46
47
fail-fast : false
47
48
matrix :
@@ -64,12 +65,24 @@ jobs:
64
65
# Get enough commits to run `ggshield secret scan commit-range` on ourselves
65
66
fetch-depth : 10
66
67
67
- - name : Set up Python 3.10
68
+ - name : Set up Python 3.10 (Windows 1/2)
69
+ if : matrix.os == 'windows-2022'
68
70
uses : actions/setup-python@v5
69
- if : " !startsWith(matrix.os, 'macos-')"
70
71
with :
71
72
python-version : ' 3.10'
72
73
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
+
73
86
- name : Install macOS specific dependencies
74
87
if : startsWith(matrix.os, 'macos-')
75
88
run : |
92
105
93
106
# Make Python available
94
107
echo PATH=$PWD/python/bin:$PATH >> $GITHUB_ENV
108
+ echo PYTHON_CMD=$PWD/python/bin/python >> $GITHUB_ENV
95
109
96
110
# Install rcodesign
97
111
RCODESIGN_VERSION=0.27.0
@@ -109,27 +123,33 @@ jobs:
109
123
- name : Install dependencies
110
124
shell : bash
111
125
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
117
132
env :
118
133
# Disable lock otherwise Windows-only dependencies like colorama are not installed
119
134
PIPENV_SKIP_LOCK : 1
120
135
121
136
- name : Install Linux specific dependencies
122
137
if : matrix.os == 'ubuntu-22.04'
123
138
run : |
139
+ # Install NFPM
124
140
NFPM_VERSION=2.36.1
125
- NFPM_CHECKSUM=05c17a1e09c470807b149fdd7bcd8f600eea044f459fc3ce81aa230103c0baf5
141
+ NFPM_CHECKSUM=9f8effa24bc6033b509611dbe68839542a63e825525b195672298c369051ef0b
126
142
127
143
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 \
130
146
$NFPM_CHECKSUM
131
147
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 '*'
133
153
134
154
- name : Prepare macOS secrets
135
155
if : startsWith(matrix.os, 'macos-') && inputs.release_mode
@@ -199,7 +219,7 @@ jobs:
199
219
else
200
220
args="--git-version"
201
221
fi
202
- scripts/build-os-packages/build-os-packages $args
222
+ pipenv run scripts/build-os-packages/build-os-packages $args
203
223
204
224
- name : Override base Docker image used for functional tests on Windows
205
225
if : matrix.os == 'windows-2022'
@@ -214,7 +234,7 @@ jobs:
214
234
# See note about steps requiring the GITGUARDIAN_API at the top of this file
215
235
if : ${{ !github.event.pull_request.head.repo.fork }}
216
236
run : |
217
- scripts/build-os-packages/build-os-packages functests
237
+ pipenv run scripts/build-os-packages/build-os-packages functests
218
238
env :
219
239
GITGUARDIAN_API_KEY : ${{ secrets.GITGUARDIAN_API_KEY }}
220
240
GITGUARDIAN_API_URL : ${{ secrets.GITGUARDIAN_API_URL }}
0 commit comments