Skip to content

Commit 31883c3

Browse files
committed
CI: test
1 parent cd96692 commit 31883c3

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/publish.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ name: Publish
55
on: push # yamllint disable-line rule:truthy
66

77
jobs:
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:
@@ -19,6 +23,12 @@ jobs:
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
@@ -29,6 +39,7 @@ jobs:
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:
@@ -46,7 +57,6 @@ jobs:
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

0 commit comments

Comments
 (0)