|
4 | 4 | workflow_dispatch: |
5 | 5 | push: |
6 | 6 | tags: |
7 | | - - "202[2-9].0[1-9].[1-9]" # 2022.02.2 |
8 | | - - "202[2-9].0[1-9].[1-9][0-9]" # 2022.02.22 |
9 | | - - "202[2-9].1[0-2].[1-9]" # 2022.11.1 |
10 | | - - "202[2-9].1[0-2].[1-9][0-9]" # 2022.11.11 |
| 7 | + - "202[3-9].0[1-9].[1-9]" # 2023.02.2 |
| 8 | + - "202[3-9].0[1-9].[1-9]-rc[0-9]+" # 2023.02.2-rc1 |
| 9 | + - "202[3-9].0[1-9].[1-9][0-9]" # 2023.02.22 |
| 10 | + - "202[3-9].0[1-9].[1-9][0-9]-rc[0-9]+" # 2023.02.22-rc1 |
| 11 | + - "202[3-9].1[0-2].[1-9]" # 2023.11.1 |
| 12 | + - "202[3-9].1[0-2].[1-9]-rc[0-9]+" # 2023.11.1-rc1 |
| 13 | + - "202[3-9].1[0-2].[1-9][0-9]" # 2023.11.11 |
| 14 | + - "202[3-9].1[0-2].[1-9][0-9]-rc[0-9]+" # 2023.11.11-rc1 |
11 | 15 |
|
12 | 16 | defaults: |
13 | 17 | run: |
@@ -39,18 +43,15 @@ jobs: |
39 | 43 | run: ./bin/coverage.sh |
40 | 44 |
|
41 | 45 | - name: Package |
42 | | - run: ./bin/package.sh |
| 46 | + run: pyinstaller --onefile pyinstaller_entrypoint.py --name hashfields |
43 | 47 |
|
44 | 48 | - name: Make artifact path |
45 | 49 | id: make-path |
46 | 50 | env: |
47 | 51 | ref: ${{ github.ref }} |
48 | | - os: ${{ matrix.os }} |
| 52 | + runner: ${{ runner.os }} |
49 | 53 | run: | |
50 | | - # strip off the -latest, replace ubuntu with linux |
51 | | - os=${os/-latest/} |
52 | | - os=${os/ubuntu/linux} |
53 | | - echo "path=hashfields-${ref/refs\/tags\//}-${os}.zip" >> $GITHUB_OUTPUT |
| 54 | + echo "path=hashfields-${ref/refs\/tags\//}-${runner}.zip" >> $GITHUB_OUTPUT |
54 | 55 |
|
55 | 56 | - name: Zip (Linux) |
56 | 57 | if: runner.os != 'Windows' |
@@ -80,18 +81,64 @@ jobs: |
80 | 81 |
|
81 | 82 | needs: package |
82 | 83 |
|
| 84 | + permissions: |
| 85 | + # https://github.com/softprops/action-gh-release#permissions |
| 86 | + contents: write |
| 87 | + |
83 | 88 | steps: |
84 | 89 | - name: Checkout |
85 | 90 | uses: actions/checkout@v4 |
86 | 91 |
|
| 92 | + - uses: actions/setup-python@v4 |
| 93 | + with: |
| 94 | + python-version-file: .github/workflows/.python-version |
| 95 | + cache: pip |
| 96 | + cache-dependency-path: "**/pyproject.toml" |
| 97 | + |
| 98 | + - name: Install build dependencies |
| 99 | + run: pip install -e .[dist] |
| 100 | + |
| 101 | + - name: Build package |
| 102 | + run: | |
| 103 | + python -m build |
| 104 | + ls -al ./dist |
| 105 | +
|
87 | 106 | - name: Download artifacts |
88 | 107 | uses: actions/download-artifact@v3 |
89 | 108 | with: |
90 | 109 | name: package |
91 | 110 | path: ./package |
92 | 111 |
|
| 112 | + - name: Check artifacts |
| 113 | + run: | |
| 114 | + ls -al ./package |
| 115 | +
|
93 | 116 | - name: Release |
| 117 | + id: release |
94 | 118 | uses: softprops/action-gh-release@v1 |
95 | 119 | with: |
96 | | - files: "./package/*.zip" |
97 | | - token: ${{ secrets.PAT_RELEASE }} |
| 120 | + files: | |
| 121 | + ./dist/*.whl |
| 122 | + ./dist/*.tar.gz |
| 123 | + ./package/*.zip |
| 124 | + prerelease: ${{ contains(github.ref, '-rc') }} |
| 125 | + generate_release_notes: ${{ !contains(github.ref, '-rc') }} |
| 126 | + |
| 127 | + - name: Publish to Test PyPI |
| 128 | + uses: pypa/gh-action-pypi-publish@release/v1.5 |
| 129 | + if: ${{ contains(github.ref, '-rc') }} |
| 130 | + with: |
| 131 | + user: __token__ |
| 132 | + password: ${{ secrets.PYPI_TEST_API_TOKEN }} |
| 133 | + repository_url: https://test.pypi.org/legacy/ |
| 134 | + print_hash: true |
| 135 | + skip_existing: true |
| 136 | + verbose: true |
| 137 | + |
| 138 | + - name: Publish to PyPI |
| 139 | + uses: pypa/gh-action-pypi-publish@release/v1.5 |
| 140 | + if: ${{ !contains(github.ref, '-rc') }} |
| 141 | + with: |
| 142 | + user: __token__ |
| 143 | + password: ${{ secrets.PYPI_API_TOKEN }} |
| 144 | + print_hash: true |
0 commit comments