Skip to content

Commit d77a78f

Browse files
committed
update distribution steps
1 parent cc8bb2a commit d77a78f

File tree

1 file changed

+37
-32
lines changed

1 file changed

+37
-32
lines changed

.github/workflows/python-package-conda.yml

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
uses: actions/setup-python@v2
5353
with:
5454
python-version: "3.13"
55-
55+
5656
- name: Create Conda environment file
5757
run: |
5858
python -m pip install pyyaml
@@ -96,45 +96,50 @@ jobs:
9696
verbose: true # optional (default = false)
9797
token: ${{ secrets.CODECOV_TOKEN }} # required
9898

99-
distribute:
100-
name: Distributing from 3.11
101-
needs: build-and-test
102-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
99+
build_sdist:
100+
name: Build source distribution
103101
runs-on: ubuntu-latest
102+
steps:
103+
- uses: actions/checkout@v5
104+
with:
105+
fetch-depth: 0
106+
107+
- name: Build sdist
108+
run: pipx run build --sdist
109+
110+
- uses: actions/upload-artifact@v4
111+
with:
112+
name: cibw-sdist
113+
path: dist/*.tar.gz
114+
115+
release:
116+
needs: [
117+
build_sdist
118+
]
119+
runs-on: ubuntu-latest
120+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
104121
defaults:
105122
run:
106123
shell: bash -l {0}
107-
108124
steps:
109-
- uses: actions/checkout@v4
110-
- name: Setup Conda
111-
uses: conda-incubator/setup-miniconda@v3
125+
- uses: actions/download-artifact@v4
112126
with:
113-
python-version: "3.11"
114-
channels: defaults
115-
channel-priority: true
116-
activate-environment: dev
127+
# unpacks all CIBW artifacts into dist/
128+
pattern: cibw-*
129+
path: dist
130+
merge-multiple: true
117131

118-
- name: Install Env
119-
run: |
120-
conda info
121-
conda list
122-
conda config --show
123-
124-
- name: Create environment
125-
run: |
126-
conda install --quiet --yes -c conda-forge \
127-
pip numpy scipy cython mkl=2023 \
128-
mkl-devel pkg-config meson-python meson ninja setuptools_scm \
129-
python-build
130-
131-
- name: Generate Source Distribution
132-
run: |
133-
python -m build --no-isolation --skip-dependency-check --sdist .
132+
- name: Release to github
133+
uses: softprops/action-gh-release@v2
134+
with:
135+
files: dist/*
136+
generate_release_notes: true
137+
prerelease: false
134138

135-
- name: pypi-publish
136-
uses: pypa/gh-action-pypi-publish@v1.4.2
139+
- name: Upload wheels to pypi
140+
uses: pypa/gh-action-pypi-publish@release/v1
137141
with:
138142
user: __token__
139143
password: ${{ secrets.PYPI_API_TOKEN }}
140-
skip_existing: true
144+
skip-existing: true
145+
packages-dir: ./dist/

0 commit comments

Comments
 (0)