File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,14 @@ name: Publish
55on : push # yamllint disable-line rule:truthy
66
77jobs :
8+ # set-unique-version:
9+ # name: Set unique version for non-tag builds
10+ # if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
11+ # runs-on: ubuntu-latest
12+
813 build :
914 name : Build distribution package
1015 runs-on : ubuntu-latest
11-
1216 steps :
1317 - uses : actions/checkout@v4
1418 with :
1923 python-version : " 3.x"
2024 - name : Install pypa/build
2125 run : python -m pip install --user build
26+ - name : Set unique version for non-tag builds
27+ if : ${{ ! startsWith(github.ref, 'refs/tags/') }}
28+ run : # for non-tags, add '.devN' to version
29+ sed -i
30+ " /^APP_VERSION = /s/'$/.dev$(git describe --tags | cut -d- -f2)'/"
31+ yamllint/__init__.py
2232 - name : Build a binary wheel and a source tarball
2333 run : python -m build
2434 - name : Store the distribution packages
2939
3040 publish-to-testpypi :
3141 name : Publish distribution package to TestPyPI
42+ # if: github.ref == 'refs/heads/master'
3243 needs : build
3344 runs-on : ubuntu-latest
3445 environment :
4657 uses : pypa/gh-action-pypi-publish@release/v1
4758 with :
4859 repository-url : https://test.pypi.org/legacy/
49- skip-existing : true
5060
5161 publish-to-pypi :
5262 name : Publish distribution package to PyPI
You can’t perform that action at this time.
0 commit comments