|
6 | 6 | - master |
7 | 7 |
|
8 | 8 | 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 | | - |
40 | 9 | build_wheels: |
41 | | - if: contains(needs.create_release.outputs.mod_files, 'src/fcl/version.py') |
42 | 10 | name: Build wheel on ${{matrix.platform}} |
43 | 11 | runs-on: ${{matrix.platform}} |
44 | | - needs: create_release |
45 | 12 | strategy: |
46 | 13 | matrix: |
47 | 14 | platform: [ubuntu-latest, macos-latest, windows-latest, macos-14] |
48 | 15 | steps: |
49 | 16 | - uses: actions/checkout@v3 |
50 | 17 | - name: Build wheels |
51 | 18 | uses: pypa/cibuildwheel@v2.16.5 |
52 | | - env: |
53 | | - CIBW_ARCHS_MACOS: 'x86_64 arm64' |
54 | 19 | - uses: actions/upload-artifact@v3 |
55 | 20 | with: |
56 | 21 | 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 |
65 | 22 |
|
66 | 23 | 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] |
69 | 26 | runs-on: ubuntu-latest |
70 | 27 | steps: |
71 | 28 | - uses: actions/download-artifact@v3 |
|
76 | 33 | with: |
77 | 34 | user: __token__ |
78 | 35 | 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