-
Notifications
You must be signed in to change notification settings - Fork 10
75 lines (67 loc) · 2.27 KB
/
Copy pathsemantic-release.yml
File metadata and controls
75 lines (67 loc) · 2.27 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
name: Semantic Release
on:
push:
branches: [main]
workflow_run:
workflows: ["Quality Checks", "Unit Tests", "Security Scanning", "Workflow Validation", "Changelog Validation", "Container Build", "PyPI Publishing", "Documentation"]
types: [completed]
branches: [main]
workflow_dispatch:
inputs:
mode:
description: 'Release mode'
required: false
default: 'forward'
type: choice
options:
- forward
- historical
- analysis
commit:
description: 'Commit hash (for historical releases)'
required: false
type: string
version:
description: 'Version (for historical releases)'
required: false
type: string
permissions:
contents: write
id-token: write
packages: write
concurrency:
group: "semantic-release"
cancel-in-progress: false
jobs:
release:
name: Semantic Release
runs-on: ubuntu-latest
if: |
(github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, 'release:')) ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' && contains(github.event.workflow_run.head_commit.message, 'release:'))
steps:
- name: Generate GitHub App Token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: Checkout code
uses: actions/checkout@v6.0.1
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- name: Python Semantic Release
id: release
uses: python-semantic-release/python-semantic-release@v10.5.3
with:
github_token: ${{ steps.app-token.outputs.token }}
git_committer_name: "github-actions[bot]"
git_committer_email: "github-actions[bot]@users.noreply.github.com"
- name: Publish to GitHub Release Assets
uses: python-semantic-release/publish-action@v10.5.3
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ steps.app-token.outputs.token }}
tag: ${{ steps.release.outputs.tag }}