-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 1.8 KB
/
release.yaml
File metadata and controls
65 lines (56 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: build
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
pull_request:
branches: [main] # PR verification only (base=main)
push:
branches: [main] # releases on merges to main
jobs:
# Build job for PR verification
build:
if: github.event_name == 'pull_request'
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: ./.github/actions/python-init
- name: Build sdist and wheel
run: uv build
- uses: ./.github/actions/python-post
# Publish releases on changes to main
release:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'paddy74/python-usajobsapi'
name: Create a Release
runs-on: ubuntu-latest
permissions:
contents: write # tags + GitHub Release
id-token: write # PyPI Trusted Publishing
environment:
name: pypi
url: https://pypi.org/p/python-usajobsapi
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Python Semantic Release
id: release
uses: python-semantic-release/python-semantic-release@v10
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish pkg to GitHub Releases
uses: python-semantic-release/publish-action@v10
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish pkg to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: steps.release.outputs.released == 'true'
with:
packages-dir: dist
skip-existing: true