Skip to content

Commit c27748e

Browse files
committed
CI: test
1 parent cd96692 commit c27748e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/publish.yaml

Lines changed: 11 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,11 @@ 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: # changes version to e.g. '1.36.2.dev-gcd96692'
29+
sed -i "/^APP_VERSION = /s/'$/.g$(git rev-parse --short HEAD)'/"
30+
yamllint/__init__.py
2231
- name: Build a binary wheel and a source tarball
2332
run: python -m build
2433
- name: Store the distribution packages
@@ -29,6 +38,7 @@ jobs:
2938

3039
publish-to-testpypi:
3140
name: Publish distribution package to TestPyPI
41+
#if: github.ref == 'refs/heads/master'
3242
needs: build
3343
runs-on: ubuntu-latest
3444
environment:
@@ -46,7 +56,6 @@ jobs:
4656
uses: pypa/gh-action-pypi-publish@release/v1
4757
with:
4858
repository-url: https://test.pypi.org/legacy/
49-
skip-existing: true
5059

5160
publish-to-pypi:
5261
name: Publish distribution package to PyPI

0 commit comments

Comments
 (0)