Skip to content

Commit b33d5ae

Browse files
committed
fix: releases
1 parent a098d99 commit b33d5ae

File tree

1 file changed

+17
-63
lines changed

1 file changed

+17
-63
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -2,77 +2,31 @@ name: Release
22

33
on:
44
push:
5-
branches:
6-
- main
5+
tags:
6+
- "*"
7+
workflow_dispatch:
78

89
jobs:
910
release:
10-
name: Release
11+
name: release
1112
runs-on: ubuntu-latest
12-
permissions:
13-
id-token: write
1413
environment:
1514
name: release
1615
url: https://pypi.org/p/stac-api-validator
16+
permissions:
17+
id-token: write
18+
if: ${{ github.repository }} == 'stac-utils/stac-api-validator'
1719
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
2422
uses: actions/setup-python@v5
2523
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-
uses: salsify/[email protected]
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
5926
run: |
60-
poetry build --ansi
61-
62-
- name: Publish package on PyPI
63-
if: steps.check-version.outputs.tag
64-
uses: pypa/[email protected]
65-
66-
- name: Publish package on TestPyPI
67-
if: "! steps.check-version.outputs.tag"
68-
uses: pypa/[email protected]
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

Comments
 (0)