Skip to content

Commit 0cb622d

Browse files
committed
chore: simplify
1 parent fb9bfa5 commit 0cb622d

2 files changed

Lines changed: 29 additions & 73 deletions

File tree

.github/workflows/build.yml

Lines changed: 20 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -4,105 +4,63 @@ on:
44
workflow_call:
55
inputs:
66
registry-name:
7-
description: 'Name of the registry (e.g., pypi, testpypi)'
7+
description: "Name of the registry (e.g., pypi, testpypi)"
88
required: true
99
type: string
1010
registry-url:
11-
description: 'URL of the registry'
11+
description: "URL of the registry"
1212
required: true
1313
type: string
14-
package-name:
15-
description: 'Name of the package'
16-
required: true
17-
type: string
18-
python-versions:
19-
description: 'Python versions to build for'
14+
python-version:
15+
description: "Python version to build with"
2016
required: false
2117
type: string
22-
default: |
23-
3.9
24-
3.10
25-
3.11
26-
3.12
27-
3.13
28-
runner-os:
29-
description: 'Runner operating systems'
30-
required: false
31-
type: string
32-
default: '["ubuntu-latest", "ubuntu-24.04-arm", "macos-13", "macos-latest"]'
18+
default: "3.11"
3319

3420
jobs:
35-
build_wheels:
36-
name: Build wheels on ${{ matrix.os }}
37-
runs-on: ${{ matrix.os }}
38-
strategy:
39-
matrix:
40-
os: ${{ fromJson(inputs.runner-os) }}
21+
sdist:
22+
name: Build source distribution
23+
runs-on: ubuntu-latest
4124

4225
steps:
4326
- uses: actions/checkout@v4
4427
with:
45-
submodules: 'recursive'
46-
28+
submodules: "recursive"
29+
4730
- uses: actions/setup-python@v5
4831
with:
49-
python-version: ${{ inputs.python-versions }}
50-
51-
- name: Update package name in setup.py and cli
52-
if: ${{ inputs.package-name != 'science-synapse' }}
53-
shell: bash
54-
run: |
55-
if [[ "$RUNNER_OS" == "Linux" ]]; then
56-
if [ -f "setup.py" ]; then
57-
sed -i "s/science-synapse/${{ inputs.package-name }}/g" setup.py
58-
fi
59-
if [ -f "synapse/cli/__main__.py" ]; then
60-
sed -i "s/science-synapse/${{ inputs.package-name }}/g" synapse/cli/__main__.py
61-
fi
62-
else
63-
if [ -f "setup.py" ]; then
64-
sed -i '' "s/science-synapse/${{ inputs.package-name }}/g" setup.py
65-
fi
66-
if [ -f "synapse/cli/__main__.py" ]; then
67-
sed -i '' "s/science-synapse/${{ inputs.package-name }}/g" synapse/cli/__main__.py
68-
fi
69-
fi
70-
71-
- name: Install cibuildwheel
72-
run: python -m pip install cibuildwheel==2.22.0
32+
python-version: ${{ inputs.python-version }}
7333

7434
- name: Prep repo
7535
run: |
7636
pip install -r requirements.txt
7737
make
7838
79-
- name: Build wheels
80-
run: python -m cibuildwheel --output-dir wheelhouse
39+
- name: Build sdist
40+
run: python -m build --sdist
8141

8242
- uses: actions/upload-artifact@v4
8343
with:
84-
name: cibw-wheels-${{ inputs.package-name }}-${{ matrix.os }}-${{ strategy.job-index }}
85-
path: ./wheelhouse/*.whl
44+
name: sdist
45+
path: dist/*.tar.gz
8646

8747
publish:
88-
name: Upload wheels to ${{ inputs.registry-name }}
89-
needs: [build_wheels]
48+
name: Publish to ${{ inputs.registry-name }}
49+
needs: [sdist]
9050
runs-on: ubuntu-latest
9151
environment:
9252
name: ${{ inputs.registry-name }}
93-
url: ${{ inputs.registry-url }}${{ inputs.package-name }}
53+
url: ${{ inputs.registry-url }}
9454
permissions:
9555
id-token: write
96-
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
9756

9857
steps:
9958
- uses: actions/download-artifact@v4
10059
with:
101-
pattern: cibw-wheels-${{ inputs.package-name }}*
60+
name: sdist
10261
path: dist
103-
merge-multiple: true
10462

105-
- name: List wheels
63+
- name: List files
10664
run: ls -la dist/
10765

10866
- name: Publish package distributions to ${{ inputs.registry-name }}

.github/workflows/release.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
push:
66
tags:
7-
- 'v*'
7+
- "v*"
88

99
permissions:
1010
id-token: write
@@ -13,14 +13,12 @@ jobs:
1313
test-pypi-release:
1414
uses: ./.github/workflows/build.yml
1515
with:
16-
registry-name: 'testpypi'
17-
registry-url: 'https://test.pypi.org/legacy/'
18-
package-name: 'test-science-synapse'
16+
registry-name: "testpypi"
17+
registry-url: "https://test.pypi.org/legacy/"
1918

20-
pypi-release:
21-
uses: ./.github/workflows/build.yml
22-
with:
23-
registry-name: 'pypi'
24-
registry-url: 'https://pypi.org/p/'
25-
package-name: 'science-synapse'
26-
needs: test-pypi-release
19+
# pypi-release:
20+
# uses: ./.github/workflows/build.yml
21+
# with:
22+
# registry-name: "pypi"
23+
# registry-url: "https://pypi.org/p/"
24+
# needs: test-pypi-release

0 commit comments

Comments
 (0)