-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (52 loc) · 1.5 KB
/
workflow.yml
File metadata and controls
63 lines (52 loc) · 1.5 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
name: Python Package Release
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
id-token: write
actions: write
packages: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine python-semantic-release setuptools-scm
- name: Configure Git for semantic-release
run: |
git config --local user.name "github-actions"
git config --local user.email "github-actions@github.com"
- name: Run semantic-release (version & changelog)
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
semantic-release version
semantic-release publish
- name: Build the package
run: python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*
- name: Raise PR from main to master
uses: peter-evans/create-pull-request@v5
with:
base: master
head: main
title: "Release PR: main → master"
body: "Merges release changes from main into master"
branch: pr-main-to-master