|
1 | 1 | name: Release |
2 | 2 |
|
3 | 3 | on: |
| 4 | + pull_request: |
| 5 | + branches-ignore: |
| 6 | + - 'main' |
4 | 7 | push: |
5 | 8 | tags: |
6 | 9 | - '[0-9]+.[0-9]+.[0-9]+' |
7 | 10 | - '[0-9]+.[0-9]+.[0-9]+rc[0-9]+' |
8 | 11 |
|
9 | 12 | jobs: |
10 | 13 | release-to-pypi: |
11 | | - runs-on: ubuntu-22.04 |
| 14 | + runs-on: ubuntu-24.04 |
| 15 | + environment: release |
| 16 | + permissions: |
| 17 | + id-token: write |
12 | 18 | steps: |
13 | | - - uses: actions/checkout@v3 |
14 | | - - name: Set up Python |
15 | | - uses: actions/setup-python@v4 |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + - name: Set up PDM |
| 21 | + uses: pdm-project/setup-pdm@v4 |
16 | 22 | with: |
17 | | - python-version: '3.7' |
18 | | - - name: Install dependencies |
19 | | - run: | |
20 | | - python -m pip install --upgrade pip |
21 | | - pip install --upgrade setuptools wheel twine |
22 | | - - name: Build and publish |
| 23 | + cache: true |
| 24 | + - name: Build |
| 25 | + run: pdm build |
23 | 26 | env: |
24 | | - TWINE_USERNAME: __token__ |
25 | | - TWINE_PASSWORD: ${{ secrets.PYPI_PWD }} |
26 | | - run: | |
27 | | - python3 setup.py release |
28 | | - twine upload dist/* |
29 | | - # push artifacts for other jobs to use |
| 27 | + PDM_BUILD_SCM_VERSION: ${{github.ref_name}} |
| 28 | + - name: Publish package distributions to PyPI |
| 29 | + uses: pypa/gh-action-pypi-publish@release/v1 |
30 | 30 | - name: Upload packages as artifacts |
31 | | - uses: actions/upload-artifact@v2-preview |
| 31 | + uses: actions/upload-artifact@v4 |
32 | 32 | with: |
33 | 33 | name: chaostoolkit-reporting-packages |
34 | | - path: dist/chaostoolkit_reporting-* |
| 34 | + path: dist/lueur* |
35 | 35 |
|
36 | 36 | create-gh-release: |
37 | | - runs-on: ubuntu-22.04 |
| 37 | + runs-on: ubuntu-24.04 |
38 | 38 | steps: |
39 | 39 | - name: Create Release |
40 | | - uses: actions/create-release@latest |
41 | | - env: |
42 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
| 40 | + uses: softprops/action-gh-release@v2 |
43 | 41 | with: |
44 | 42 | tag_name: ${{ github.ref }} |
45 | | - release_name: Release ${{ github.ref }} |
| 43 | + name: Release ${{ github.ref }} |
46 | 44 | draft: false |
47 | 45 | prerelease: false |
48 | 46 |
|
49 | 47 | upload-gh-release-assets: |
50 | | - runs-on: ubuntu-22.04 |
| 48 | + runs-on: ubuntu-24.04 |
51 | 49 | needs: |
52 | 50 | - create-gh-release |
53 | 51 | - release-to-pypi |
54 | 52 | steps: |
55 | 53 | - name: Download pypi artifacts |
56 | | - uses: actions/download-artifact@v2-preview |
| 54 | + uses: actions/download-artifact@v4 |
57 | 55 | with: |
58 | 56 | name: chaostoolkit-reporting-packages |
59 | 57 | path: dist |
|
0 commit comments