@@ -2,77 +2,31 @@ name: Release
2
2
3
3
on :
4
4
push :
5
- branches :
6
- - main
5
+ tags :
6
+ - " *"
7
+ workflow_dispatch :
7
8
8
9
jobs :
9
10
release :
10
- name : Release
11
+ name : release
11
12
runs-on : ubuntu-latest
12
- permissions :
13
- id-token : write
14
13
environment :
15
14
name : release
16
15
url : https://pypi.org/p/stac-api-validator
16
+ permissions :
17
+ id-token : write
18
+ if : ${{ github.repository }} == 'stac-utils/stac-api-validator'
17
19
steps :
18
- - name : Check out the repository
19
- uses : actions/checkout@v4
20
- with :
21
- fetch-depth : 2
22
-
23
- - name : Set up Python
20
+ - uses : actions/checkout@v4
21
+ - name : Set up Python 3.x
24
22
uses : actions/setup-python@v5
25
23
with :
26
- python-version : " 3.10"
27
-
28
- - name : Upgrade pip
29
- run : |
30
- pip install --constraint=.github/workflows/constraints.txt pip
31
- pip --version
32
-
33
- - name : Install Poetry
34
- run : |
35
- pip install --constraint=.github/workflows/constraints.txt poetry
36
- poetry --version
37
-
38
- - name : Check if there is a parent commit
39
- id : check-parent-commit
40
- run : |
41
- echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)"
42
-
43
- - name : Detect and tag new version
44
- id : check-version
45
- if : steps.check-parent-commit.outputs.sha
46
-
47
- with :
48
- version-command : |
49
- bash -o pipefail -c "poetry version | awk '{ print \$2 }'"
50
-
51
- - name : Bump version for developmental release
52
- if : " ! steps.check-version.outputs.tag"
53
- run : |
54
- poetry version patch &&
55
- version=$(poetry version | awk '{ print $2 }') &&
56
- poetry version $version.dev.$(date +%s)
57
-
58
- - name : Build package
24
+ python-version : " 3.x"
25
+ - name : Install build
59
26
run : |
60
- poetry build --ansi
61
-
62
- - name : Publish package on PyPI
63
- if : steps.check-version.outputs.tag
64
-
65
-
66
- - name : Publish package on TestPyPI
67
- if : " ! steps.check-version.outputs.tag"
68
-
69
- with :
70
- repository-url : https://test.pypi.org/legacy/
71
-
72
- - name : Publish the release notes
73
- uses :
release-drafter/[email protected]
74
- with :
75
- publish : ${{ steps.check-version.outputs.tag != '' }}
76
- tag : ${{ steps.check-version.outputs.tag }}
77
- env :
78
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
27
+ python -m pip install --upgrade pip
28
+ pip install build
29
+ - name : Build
30
+ run : python -m build
31
+ - name : Publish to PyPI
32
+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments