Skip to content

Commit dc657ec

Browse files
Fixes (#9)
1 parent 2907400 commit dc657ec

5 files changed

Lines changed: 35 additions & 30 deletions

File tree

.github/workflows/test_devcontainer.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828
run: |
2929
set -e
3030
ls -l dist
31-
ls dist/test-module-1.0.0.tar.gz
3231
ls dist/test_module-1.0.0-py3-none-any.whl
3332
3433
test-devcontainer-arm64v8:
@@ -54,7 +53,6 @@ jobs:
5453
run: |
5554
set -e
5655
ls -l dist
57-
ls dist/test-module-1.0.0.tar.gz
5856
ls dist/test_module-1.0.0-py3-none-any.whl
5957
6058
test-devcontainer-amd64:
@@ -78,5 +76,4 @@ jobs:
7876
run: |
7977
set -e
8078
ls -l dist
81-
ls dist/test-module-1.0.0.tar.gz
8279
ls dist/test_module-1.0.0-py3-none-any.whl

.github/workflows/test_native.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test platform independent Python packaging
1+
name: Test native Python packaging
22

33
on:
44
pull_request:
@@ -12,6 +12,10 @@ 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+
echo "/tmp/packaging-tools/python" >> $GITHUB_PATH
1519
- name: Set up test environment
1620
run: |
1721
cp -a test/. .
@@ -26,7 +30,6 @@ jobs:
2630
run: |
2731
set -e
2832
ls -l dist
29-
ls dist/test-module-1.0.0.tar.gz
3033
ls dist/test_module-1.0.0-py3-none-any.whl
3134
ls dist/python3-test-module_1.0.0_all.deb
3235
@@ -37,6 +40,10 @@ jobs:
3740

3841
steps:
3942
- 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+
echo "/tmp/packaging-tools/python" >> $GITHUB_PATH
4047
- name: Set up test environment
4148
run: |
4249
cp -a test/. .
@@ -52,7 +59,6 @@ jobs:
5259
run: |
5360
set -e
5461
ls -l dist
55-
ls dist/test-module-1.0.0.tar.gz
5662
ls dist/test_module-1.0.0-py3-none-any.whl
5763
ls dist/python-test-module_1.0.0_all.deb
5864
@@ -63,6 +69,10 @@ jobs:
6369

6470
steps:
6571
- 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+
echo "/tmp/packaging-tools/python" >> $GITHUB_PATH
6676
- name: Set up test environment
6777
run: |
6878
cp -a test/. .
@@ -77,7 +87,6 @@ jobs:
7787
run: |
7888
set -e
7989
ls -l dist
80-
ls dist/test-module-1.0.0.tar.gz
8190
ls dist/test_module-1.0.0-py3-none-any.whl
8291
ls dist/test-module_1.0.0-1_all.deb
8392
@@ -88,6 +97,10 @@ jobs:
8897

8998
steps:
9099
- 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+
echo "/tmp/packaging-tools/python" >> $GITHUB_PATH
91104
- name: Set up test environment
92105
run: |
93106
cp -a test/. .
@@ -103,6 +116,5 @@ jobs:
103116
run: |
104117
set -e
105118
ls -l dist
106-
ls dist/test-module-1.0.0.tar.gz
107119
ls dist/test_module-1.0.0-py3-none-any.whl
108120
ls dist/test-module_1.0.0_amd64.deb

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ Create Python distribution packages: source, wheel and Debian packages
2727
- `use-devcontainer`: Create packages using a devcontainer (default: `false`)
2828
- `pre-build-command`: Command to run before the package creation
2929
- `post-build-command`: Command to run after the package creation
30+
- `add-source-dist`: Add source distribution to the package creation (default: `true`)
3031

3132
### Platform independent or native package creation
3233

3334
- `python-version`: Python version to use for the package creation (default: `3.9`)
34-
- `add-source-dist`: Add source distribution to the package creation (default: `true`)
3535
- `add-wheel-dist`: Add wheel distribution to the package creation (default: `true`)
3636
- `debian-dist-type`: Type of the Debian package to create: `fpm-deb`/`dh-virtualenv`/`none` (default: `none`)
3737
- `debian-dist-command`: Command to run for the Debian package creation (default: `pack_python . -s fpm-deb` or `pack_python . -s dh-virtualenv`)

action.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ inputs:
1313
description: 'Build packages using devcontainer'
1414
required: false
1515
default: 'false'
16+
add-source-dist:
17+
description: 'Should create source distribution?'
18+
required: false
19+
default: 'true'
1620
pre-build-command:
1721
description: 'Command to execute before packaging'
1822
required: false
@@ -24,10 +28,6 @@ inputs:
2428
description: 'Python version'
2529
required: false
2630
default: '3.9'
27-
add-source-dist:
28-
description: 'Should create source distribution?'
29-
required: false
30-
default: 'true'
3131
add-wheel-dist:
3232
description: 'Should create wheel distribution?'
3333
required: false
@@ -71,11 +71,9 @@ runs:
7171
using: 'composite'
7272
steps:
7373
- name: Symlink current Actions repo
74-
env:
75-
GH_ACTION_REPO: ${{ github.action_repository }}
76-
GH_ACTION_REF: ${{ github.action_ref }}
74+
working-directory: ${{ github.action_path }}
7775
shell: bash
78-
run: ln -s /home/runner/work/_actions/$GH_ACTION_REPO/$GH_ACTION_REF/ /home/runner/work/_actions/current
76+
run: ln -fs $(realpath ../) ${{ github.workspace }}/
7977
- name: Set up environment
8078
id: set-env
8179
shell: bash
@@ -93,11 +91,22 @@ runs:
9391
shell: bash
9492
run: sed -i "s/version='.*',/version='$VERSION',/" setup.py
9593

94+
- name: Install packaging tools
95+
shell: bash
96+
run: |
97+
git clone https://github.com/EffectiveRange/packaging-tools.git /tmp/packaging-tools
98+
echo "/tmp/packaging-tools/python" >> $GITHUB_PATH
99+
96100
- if: ${{ inputs.pre-build-command }}
97101
name: Run pre-build command
98102
shell: bash
99103
run: ${{ inputs.pre-build-command }}
100104

105+
- if: ${{ inputs.add-source-dist == 'true' }}
106+
name: Create source distribution
107+
shell: bash
108+
run: python setup.py sdist
109+
101110
- if: ${{ inputs.use-devcontainer != 'true' }}
102111
name: Build native packages
103112
uses: ./native

native/action.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ inputs:
99
description: 'Python version'
1010
required: false
1111
default: '3.9'
12-
add-source-dist:
13-
description: 'Should create source distribution?'
14-
required: false
15-
default: 'true'
1612
add-wheel-dist:
1713
description: 'Should create wheel distribution?'
1814
required: false
@@ -38,15 +34,6 @@ runs:
3834
python -m pip install --upgrade pip
3935
pip install .
4036
mkdir -p dist
41-
- name: Install packaging tools
42-
shell: bash
43-
run: |
44-
git clone https://github.com/EffectiveRange/packaging-tools.git /tmp/packaging-tools
45-
echo "/tmp/packaging-tools/python" >> $GITHUB_PATH
46-
- if: ${{ inputs.add-source-dist == 'true' }}
47-
name: Create source distribution
48-
shell: bash
49-
run: python setup.py sdist
5037
- if: ${{ inputs.add-wheel-dist == 'true' }}
5138
name: Create wheel distribution
5239
shell: bash

0 commit comments

Comments
 (0)