@@ -2,6 +2,22 @@ name: Deploy | Semantic Release
2
2
3
3
on :
4
4
workflow_dispatch :
5
+ inputs :
6
+ dry_run :
7
+ description : ' Dry run (no changes will be committed)'
8
+ type : boolean
9
+ default : false
10
+ debug :
11
+ description : ' Enable verbose debugging output'
12
+ type : boolean
13
+ default : false
14
+ push :
15
+ branches :
16
+ - ' **'
17
+ paths-ignore :
18
+ - ' docs/**'
19
+ - ' *.md'
20
+ - ' .github/workflows/deploy-pypi-packages.yaml'
5
21
6
22
jobs :
7
23
release :
@@ -16,23 +32,61 @@ jobs:
16
32
with :
17
33
fetch-depth : 0
18
34
35
+ - name : Set run mode
36
+ id : set_mode
37
+ run : |
38
+ $isDryRun = "${{ github.event_name == 'push' || inputs.dry_run }}" -eq "true"
39
+ echo "is_dry_run=$isDryRun" >> $env:GITHUB_OUTPUT
40
+ echo "Mode: $($isDryRun ? 'Dry run' : 'Full release')"
41
+
42
+ - name : Python Release - Dry Run
43
+ id : release_dryrun
44
+ if : steps.set_mode.outputs.is_dry_run == 'True'
45
+ uses : python-semantic-release/python-semantic-release@v9.20.0
46
+ with :
47
+ github_token : ${{ secrets.GITHUB_TOKEN }}
48
+ push : " false"
49
+ commit : " false"
50
+ tag : " false"
51
+ changelog : " false"
52
+ root_options : ${{ inputs.debug && '-vv --noop' || '-v --noop' }}
53
+
19
54
- name : Python Release
20
55
id : release
56
+ if : ${{ github.event_name == 'workflow_dispatch' && !inputs.dry_run }}
21
57
uses : python-semantic-release/python-semantic-release@v9.20.0
22
58
with :
23
59
github_token : ${{ secrets.GITHUB_TOKEN }}
24
60
push : " true"
25
61
changelog : " true"
62
+ root_options : ${{ inputs.debug && '-vv' || '-v' }}
26
63
27
64
- name : Create Step Summary
28
65
run : |
66
+ $isDryRun = "${{ steps.set_mode.outputs.is_dry_run }}" -eq "True"
67
+ $releaseId = $isDryRun ? "release_dryrun" : "release"
68
+ $wasReleased = "${{ steps.release_dryrun.outputs.released || steps.release.outputs.released }}" -eq "true"
69
+ $version = "${{ steps.release_dryrun.outputs.version || steps.release.outputs.version }}"
70
+ $tag = "${{ steps.release_dryrun.outputs.tag || steps.release.outputs.tag }}"
71
+
72
+ # Display trigger information
73
+ $triggerInfo = if ("${{ github.event_name }}" -eq "push") {
74
+ "Triggered by push to branch: ${{ github.ref_name }}"
75
+ } else {
76
+ "Triggered manually via workflow dispatch"
77
+ }
78
+
29
79
@"
30
- # MQPy Release
80
+ # MQPy Release $($isDryRun ? "(Dry Run)" : "")
31
81
32
82
## Release Summary
33
83
34
- Version: ${{ steps.release.outputs.version }}
35
- Tag: ${{ steps.release.outputs.tag }}
84
+ $triggerInfo
85
+ $($isDryRun ? "⚠️ This is a dry run - no changes were committed" : "")
86
+
87
+ Current/Next Version: $version
88
+ Current/Next Tag: $tag
89
+ Release required: $($wasReleased ? "Yes" : "No")
36
90
37
91
## Installation Instructions
38
92
52
106
### Installation Steps
53
107
54
108
```
55
- pip install mqpy==${{ steps.release.outputs. version }}
109
+ pip install mqpy==$version
56
110
```
57
111
58
112
### Documentation
0 commit comments