Skip to content

Commit 640f017

Browse files
committed
release
1 parent c5f5203 commit 640f017

File tree

1 file changed

+58
-4
lines changed

1 file changed

+58
-4
lines changed

.github/workflows/deploy-semantic-release.yaml

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@ name: Deploy | Semantic Release
22

33
on:
44
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'
521

622
jobs:
723
release:
@@ -16,23 +32,61 @@ jobs:
1632
with:
1733
fetch-depth: 0
1834

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+
1954
- name: Python Release
2055
id: release
56+
if: ${{ github.event_name == 'workflow_dispatch' && !inputs.dry_run }}
2157
uses: python-semantic-release/python-semantic-release@v9.20.0
2258
with:
2359
github_token: ${{ secrets.GITHUB_TOKEN }}
2460
push: "true"
2561
changelog: "true"
62+
root_options: ${{ inputs.debug && '-vv' || '-v' }}
2663

2764
- name: Create Step Summary
2865
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+
2979
@"
30-
# MQPy Release
80+
# MQPy Release $($isDryRun ? "(Dry Run)" : "")
3181
3282
## Release Summary
3383
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")
3690
3791
## Installation Instructions
3892
@@ -52,7 +106,7 @@ jobs:
52106
### Installation Steps
53107
54108
```
55-
pip install mqpy==${{ steps.release.outputs.version }}
109+
pip install mqpy==$version
56110
```
57111
58112
### Documentation

0 commit comments

Comments
 (0)