Skip to content

Commit 59a4f1d

Browse files
Install packaging tools as root (#12)
1 parent 2124e19 commit 59a4f1d

6 files changed

Lines changed: 37 additions & 48 deletions

File tree

.github/workflows/test_devcontainer.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v4
15-
- name: Install packaging tools
16-
run: |
17-
git clone https://github.com/EffectiveRange/packaging-tools.git /tmp/packaging-tools
18-
sudo bash /tmp/packaging-tools/python/install.sh
1915
- name: Set up test environment
2016
run: |
2117
cp -a test/. .
@@ -42,10 +38,6 @@ jobs:
4238

4339
steps:
4440
- uses: actions/checkout@v4
45-
- name: Install packaging tools
46-
run: |
47-
git clone https://github.com/EffectiveRange/packaging-tools.git /tmp/packaging-tools
48-
sudo bash /tmp/packaging-tools/python/install.sh
4941
- name: Set up test environment
5042
run: |
5143
cp -a test/. .
@@ -72,10 +64,6 @@ jobs:
7264

7365
steps:
7466
- uses: actions/checkout@v4
75-
- name: Install packaging tools
76-
run: |
77-
git clone https://github.com/EffectiveRange/packaging-tools.git /tmp/packaging-tools
78-
sudo bash /tmp/packaging-tools/python/install.sh
7967
- name: Set up test environment
8068
run: |
8169
cp -a test/. .

.github/workflows/test_native.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v4
15-
- name: Install packaging tools
16-
run: |
17-
git clone https://github.com/EffectiveRange/packaging-tools.git /tmp/packaging-tools
18-
sudo bash /tmp/packaging-tools/python/install.sh
1915
- name: Set up test environment
2016
run: |
2117
cp -a test/. .
@@ -40,10 +36,6 @@ jobs:
4036

4137
steps:
4238
- uses: actions/checkout@v4
43-
- name: Install packaging tools
44-
run: |
45-
git clone https://github.com/EffectiveRange/packaging-tools.git /tmp/packaging-tools
46-
sudo bash /tmp/packaging-tools/python/install.sh
4739
- name: Set up test environment
4840
run: |
4941
cp -a test/. .
@@ -69,10 +61,6 @@ jobs:
6961

7062
steps:
7163
- uses: actions/checkout@v4
72-
- name: Install packaging tools
73-
run: |
74-
git clone https://github.com/EffectiveRange/packaging-tools.git /tmp/packaging-tools
75-
sudo bash /tmp/packaging-tools/python/install.sh
7664
- name: Set up test environment
7765
run: |
7866
cp -a test/. .
@@ -97,10 +85,6 @@ jobs:
9785

9886
steps:
9987
- uses: actions/checkout@v4
100-
- name: Install packaging tools
101-
run: |
102-
git clone https://github.com/EffectiveRange/packaging-tools.git /tmp/packaging-tools
103-
sudo bash /tmp/packaging-tools/python/install.sh
10488
- name: Set up test environment
10589
run: |
10690
cp -a test/. .

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,17 @@ Create Python distribution packages: source, wheel and Debian packages
2828
- `pre-build-command`: Command to run before the package creation
2929
- `post-build-command`: Command to run after the package creation
3030
- `add-source-dist`: Add source distribution to the package creation (default: `true`)
31+
- `install-packaging-tools`: Install [Python packaging tools](https://github.com/EffectiveRange/packaging-tools/tree/main/python) (default: `true`)
32+
- `add-wheel-dist`: Add wheel distribution to the package creation (default: `true`)
33+
- `debian-dist-type`: Type of the Debian package to create: `fpm-deb`/`dh-virtualenv`/`none` (default: `none`)
34+
- `debian-dist-command`: Command to run for the Debian package creation
3135

3236
### Platform independent or native package creation
3337

3438
- `python-version`: Python version to use for the package creation (default: `3.9`)
35-
- `add-wheel-dist`: Add wheel distribution to the package creation (default: `true`)
36-
- `debian-dist-type`: Type of the Debian package to create: `fpm-deb`/`dh-virtualenv`/`none` (default: `none`)
37-
- `debian-dist-command`: Command to run for the Debian package creation
3839

3940
### Cross-platform package creation
4041

41-
- `add-wheel-dist`: Add wheel distribution to the package creation (default: `true`)
42-
- `debian-dist-type`: Type of the Debian package to create: `fpm-deb`/`dh-virtualenv`/`none` (default: `none`)
43-
- `debian-dist-command`: Command to run for the Debian package creation
4442
- `docker-registry`: Docker registry to use (default: `docker.io`)
4543
- `docker-username`: Docker registry username
4644
- `docker-password`: Docker registry password

action.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ inputs:
2424
required: false
2525
default: 'true'
2626

27+
install-packaging-tools:
28+
description: 'Should install packaging tools?'
29+
required: false
30+
default: 'true'
2731
add-wheel-dist:
2832
description: 'Should create wheel distribution?'
2933
required: false
@@ -96,12 +100,6 @@ runs:
96100
shell: bash
97101
run: sed -i "s/version='.*',/version='$VERSION',/" setup.py
98102

99-
- name: Install packaging tools
100-
shell: bash
101-
run: |
102-
git clone https://github.com/EffectiveRange/packaging-tools.git /tmp/packaging-tools
103-
sudo bash /tmp/packaging-tools/python/install.sh
104-
105103
- if: ${{ inputs.pre-build-command }}
106104
name: Run pre-build command
107105
shell: bash
@@ -116,15 +114,17 @@ runs:
116114
name: Build native packages
117115
uses: ./.github/actions/native
118116
with:
119-
python-version: ${{ inputs.python-version }}
117+
install-packaging-tools: ${{ inputs.install-packaging-tools }}
120118
add-wheel-dist: ${{ inputs.add-wheel-dist }}
121119
debian-dist-type: ${{ inputs.debian-dist-type }}
122120
debian-dist-command: ${{ inputs.debian-dist-command }}
121+
python-version: ${{ inputs.python-version }}
123122

124123
- if: ${{ inputs.use-devcontainer == 'true' }}
125124
name: Build packages using a devcontainer
126125
uses: ./.github/actions/devcontainer
127126
with:
127+
install-packaging-tools: ${{ inputs.install-packaging-tools }}
128128
add-wheel-dist: ${{ inputs.add-wheel-dist }}
129129
debian-dist-type: ${{ inputs.debian-dist-type }}
130130
debian-dist-command: ${{ inputs.debian-dist-command }}

devcontainer/action.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ branding:
55
color: 'blue'
66

77
inputs:
8+
install-packaging-tools:
9+
description: 'Should install packaging tools?'
10+
required: false
11+
default: 'true'
812
add-wheel-dist:
913
description: 'Should create wheel distribution?'
1014
required: false
@@ -71,8 +75,12 @@ runs:
7175
- name: Aggregate build commands
7276
shell: bash
7377
run: |
74-
command="git clone https://github.com/EffectiveRange/packaging-tools.git /tmp/packaging-tools"
75-
command="$command && bash /tmp/packaging-tools/python/install.sh"
78+
command="ls -la"
79+
80+
if [ "${{ inputs.install-packaging-tools }}" == "true" ]; then
81+
command="$command && git clone https://github.com/EffectiveRange/packaging-tools.git /tmp/packaging-tools"
82+
command="$command && bash /tmp/packaging-tools/python/install.sh"
83+
fi
7684
7785
packaging=""
7886

native/action.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ branding:
55
color: 'white'
66

77
inputs:
8-
python-version:
9-
description: 'Python version'
8+
install-packaging-tools:
9+
description: 'Should install packaging tools?'
1010
required: false
11-
default: '3.9'
12-
11+
default: 'true'
1312
add-wheel-dist:
1413
description: 'Should create wheel distribution?'
1514
required: false
@@ -22,6 +21,11 @@ inputs:
2221
description: 'Debian packaging custom command'
2322
required: false
2423

24+
python-version:
25+
description: 'Python version'
26+
required: false
27+
default: '3.9'
28+
2529
runs:
2630
using: 'composite'
2731
steps:
@@ -34,8 +38,15 @@ runs:
3438
run: |
3539
python -m pip install --upgrade pip
3640
pip install .
37-
pip install wheel stdeb
41+
pip install wheel
3842
mkdir -p dist
43+
- if: ${{ inputs.install-packaging-tools == 'true' }}
44+
name: Install packaging tools
45+
shell: bash
46+
run: |
47+
git clone https://github.com/EffectiveRange/packaging-tools.git /tmp/packaging-tools
48+
sudo bash /tmp/packaging-tools/python/install.sh
49+
pip install stdeb
3950
- if: ${{ inputs.add-wheel-dist == 'true' }}
4051
name: Create wheel distribution
4152
shell: bash

0 commit comments

Comments
 (0)