Skip to content

Commit 4ba1e2b

Browse files
committed
change CI to match working PR wheels
1 parent 9a45423 commit 4ba1e2b

2 files changed

Lines changed: 28 additions & 48 deletions

File tree

.github/workflows/push.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: Build
1+
name: Build Pull Requests
22

3-
on: [push, pull_request, workflow_dispatch]
3+
on: [pull_request]
44

55
jobs:
66
formatting:
@@ -12,7 +12,7 @@ jobs:
1212
- name: Set up Python environment
1313
uses: actions/setup-python@v4
1414
with:
15-
python-version: "3.10"
15+
python-version: "3.12"
1616
- name: ruff
1717
run: |
1818
pip install ruff

.github/workflows/release.yml

Lines changed: 25 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,66 +6,23 @@ on:
66
- master
77

88
jobs:
9-
create_release:
10-
name: Create GitHub Release
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v3
15-
with:
16-
fetch-depth: 2
17-
- name: Get changed files
18-
id: changed-files
19-
uses: tj-actions/changed-files@v35.4.1
20-
- name: Tag Version
21-
if: contains(steps.changed-files.outputs.modified_files, 'src/fcl/version.py')
22-
id: set_tag
23-
run: |
24-
export VER=v$(python -c "exec(open('src/fcl/version.py','r').read());print(__version__)")
25-
echo "tag_name=${VER}" >> $GITHUB_OUTPUT
26-
- name: Create Release
27-
if: contains(steps.changed-files.outputs.modified_files, 'src/fcl/version.py')
28-
id: create_release
29-
uses: actions/create-release@v1
30-
env:
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32-
with:
33-
tag_name: ${{ steps.set_tag.outputs.tag_name }}
34-
release_name: ${{ steps.set_tag.outputs.tag_name }}
35-
draft: false
36-
prerelease: false
37-
outputs:
38-
mod_files: ${{ steps.changed-files.outputs.modified_files }}
39-
409
build_wheels:
41-
if: contains(needs.create_release.outputs.mod_files, 'src/fcl/version.py')
4210
name: Build wheel on ${{matrix.platform}}
4311
runs-on: ${{matrix.platform}}
44-
needs: create_release
4512
strategy:
4613
matrix:
4714
platform: [ubuntu-latest, macos-latest, windows-latest, macos-14]
4815
steps:
4916
- uses: actions/checkout@v3
5017
- name: Build wheels
5118
uses: pypa/cibuildwheel@v2.16.5
52-
env:
53-
CIBW_ARCHS_MACOS: 'x86_64 arm64'
5419
- uses: actions/upload-artifact@v3
5520
with:
5621
path: ./wheelhouse/*.whl
57-
- uses: xresloader/upload-to-github-release@v1
58-
env:
59-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60-
with:
61-
file: ./wheelhouse/*.whl
62-
overwrite: true
63-
draft: false
64-
update_latest_release: true
6522

6623
upload_pypi:
67-
if: contains(needs.create_release.outputs.mod_files, 'src/fcl/version.py')
68-
needs: [create_release, build_wheels]
24+
name: Release To PyPi
25+
needs: [build_wheels]
6926
runs-on: ubuntu-latest
7027
steps:
7128
- uses: actions/download-artifact@v3
@@ -76,3 +33,26 @@ jobs:
7633
with:
7734
user: __token__
7835
password: ${{ secrets.PYPI_API_TOKEN }}
36+
37+
create_release:
38+
name: Create GitHub Release
39+
runs-on: ubuntu-latest
40+
needs: [build_wheels]
41+
steps:
42+
- name: Checkout code
43+
uses: actions/checkout@v3
44+
with:
45+
fetch-depth: 2
46+
- name: Tag Version
47+
id: set_tag
48+
run: |
49+
export VER=v$(python -c "exec(open('src/fcl/version.py','r').read());print(__version__)")
50+
echo "tag_name=${VER}" >> $GITHUB_OUTPUT
51+
- uses: actions/download-artifact@v3
52+
with:
53+
name: artifact
54+
path: dist
55+
- uses: ncipollo/release-action@v1.14.0
56+
with:
57+
artifacts: "dist/*"
58+
tag: ${{ steps.set_tag.outputs.tag_name }}

0 commit comments

Comments
 (0)