-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (79 loc) · 2.45 KB
/
release.yml
File metadata and controls
94 lines (79 loc) · 2.45 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Release
on:
push:
branches: [main]
workflow_dispatch:
env:
PYTHON_VERSION: "3.13"
jobs:
release:
runs-on: ubuntu-latest
name: Semantic Release
permissions:
contents: write
issues: write
pull-requests: write
id-token: write # For PyPI trusted publishing
actions: read # For checkout action
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: true
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Set up Python
run: uv python install ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
uv sync --all-extras --dev
uv pip install python-semantic-release
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
# Configure git to use the token for authentication
git config url."https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/"
- name: Run Semantic Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Ensure we have latest changes before release
git fetch origin
git reset --hard origin/main
# Run semantic release
uv run semantic-release version
# publish-pypi:
# runs-on: ubuntu-latest
# name: Publish to PyPI
# needs: release
# if: needs.release.outputs.released == 'true'
# permissions:
# id-token: write # For PyPI trusted publishing
# environment:
# name: pypi
# url: https://pypi.org/p/smppai
# steps:
# - name: Checkout repository
# uses: actions/checkout@v5
# with:
# ref: main
# - name: Install uv
# uses: astral-sh/setup-uv@v7
# with:
# enable-cache: true
# - name: Set up Python
# run: uv python install ${{ env.PYTHON_VERSION }}
# - name: Install dependencies
# run: uv sync --all-extras --dev
# - name: Build package
# run: uv build
# - name: Publish to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# attestations: true