-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (40 loc) · 1.29 KB
/
release.yml
File metadata and controls
48 lines (40 loc) · 1.29 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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Version to release (e.g., 0.1.0)"
required: true
permissions:
contents: write
packages: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install toml-cli
run: pip install toml-cli
- name: Bump version in pyproject.toml
run: |
toml set --toml-path pyproject.toml project.version "${{ github.event.inputs.version }}"
- name: Commit and tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add pyproject.toml
git commit -m "Release ${{ github.event.inputs.version }}"
git tag "${{ github.event.inputs.version }}"
git push origin HEAD
git push origin "${{ github.event.inputs.version }}"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: "${{ github.event.inputs.version }}"
name: "${{ github.event.inputs.version }}"
generate_release_notes: true