Debian Codegraph @

.github/workflows/publish_all.yml

raw symbols SCIP
1 # .github/workflows/publish_testpypi.yml
2 ---
3 name: test-n-build
4 on:
5 push:
6 tags:
7 - v*
8 jobs:
9 super-test:
10 strategy:
11 max-parallel: 2
12 matrix:
13 python_v: ['3.8', '3.9', '3.10', '']
14 name: Build and Test
15 runs-on: ubuntu-latest
16 steps:
17 - uses: actions/checkout@v4
18 - uses: astral-sh/setup-uv@v4
19 # must actually checkout for version determination
20 - run: git checkout ${{ github.ref_name }}
21 - run: uv python install ${{ matrix.python_v }}
22 - run: uv python pin ${{ matrix.python_v }}
23 if: ${{ matrix.python_v != '' }}
24 # don't modify sync file! messes up version!
25 - run: uv sync --all-extras --dev --frozen # ah order here matters?
26 - run: uv build
27 - name: Reinstall from wheel
28 run: >
29 uv pip install dist/logistro-$(uv
30 run --no-sync --with setuptools-git-versioning
31 setuptools-git-versioning)-py3-none-any.whl
32
33 - name: Test
34 run: uv run --no-sync poe test
35 timeout-minutes: 8
36
37 - name: Test (Debug)
38 if: runner.debug
39 run: uv run --no-sync poe debug-test
40
41 store-build:
42 name: build release
43 needs: super-test
44 if: always() && !cancelled() && !failure()
45 runs-on: ubuntu-latest
46 steps:
47 - name: Checkout
48 uses: actions/checkout@v4
49 - uses: astral-sh/setup-uv@v4
50 - uses: actions/setup-python@v5
51 with:
52 python-version-file: "pyproject.toml"
53 - run: git checkout ${{ github.ref_name }}
54 - run: uv sync --frozen --all-extras
55 - run: uv build
56 - name: Store the distribution packages
57 uses: actions/upload-artifact@v4
58 with:
59 name: python-package-distributions
60 path: dist/
61
62 publish-to-testpypi:
63 name: >-
64 Publish Python 🐍 distribution 📦 to testPyPI
65 needs:
66 - super-test
67 - store-build
68 if: always() && !cancelled() && !failure()
69 runs-on: ubuntu-latest
70 environment:
71 name: testpypi
72 url: https://test.pypi.org/p/logistro
73 # Signs this workflow so pypi trusts it
74 permissions:
75 id-token: write
76 steps:
77 - name: Download the dists
78 uses: actions/download-artifact@v4
79 with:
80 name: python-package-distributions
81 path: dist/
82 - name: Push to testPyPi
83 uses: pypa/gh-action-pypi-publish@release/v1
84 with:
85 repository-url: https://test.pypi.org/legacy/.
86 github-release:
87 name: >-
88 Sign the Python 🐍 distribution 📦 with Sigstore
89 and upload them to GitHub Release
90 needs:
91 - publish-to-testpypi
92 - super-test
93 - store-build
94 if: always() && !cancelled() && !failure()
95 runs-on: ubuntu-latest
96
97 permissions:
98 contents: write # IMPORTANT: mandatory for making GitHub Releases
99 id-token: write # IMPORTANT: mandatory for sigstore
100
101 steps:
102 - name: Download all the dists
103 uses: actions/download-artifact@v4
104 with:
105 name: python-package-distributions
106 path: dist/
107 - name: Sign the dists with Sigstore
108 uses: sigstore/[email protected]
109 with:
110 inputs: >-
111 ./dist/*.tar.gz
112 ./dist/*.whl
113 - name: Create GitHub Release
114 env:
115 GITHUB_TOKEN: ${{ github.token }}
116 run: >-
117 gh release create
118 "$GITHUB_REF_NAME"
119 --repo "$GITHUB_REPOSITORY"
120 --notes ""
121 - name: Upload artifact signatures to GitHub Release
122 env:
123 GITHUB_TOKEN: ${{ github.token }}
124 # Upload to GitHub Release using the `gh` CLI.
125 # `dist/` contains the built packages, and the
126 # sigstore-produced signatures and certificates.
127 run: >-
128 gh release upload
129 "$GITHUB_REF_NAME" dist/**
130 --repo "$GITHUB_REPOSITORY"
131 publish-to-pypi:
132 name: >-
133 Publish Python 🐍 distribution 📦 to PyPI
134 needs:
135 - super-test
136 - store-build
137 - publish-to-testpypi
138 - github-release
139 if: always() && !cancelled() && !failure()
140 runs-on: ubuntu-latest
141 environment:
142 name: pypi
143 url: https://pypi.org/p/logistro
144 # Signs this workflow so pypi trusts it
145 permissions:
146 id-token: write
147 steps:
148 - name: Download the dists
149 uses: actions/download-artifact@v4
150 with:
151 name: python-package-distributions
152 path: dist/
153 - name: Push to PyPi
154 uses: pypa/gh-action-pypi-publish@release/v1