File tree Expand file tree Collapse file tree 1 file changed +28
-9
lines changed Expand file tree Collapse file tree 1 file changed +28
-9
lines changed Original file line number Diff line number Diff line change @@ -61,19 +61,15 @@ jobs:
61
61
with :
62
62
token : ${{ secrets.CODECOV_TOKEN }}
63
63
64
- release :
64
+ test_release :
65
65
needs :
66
66
- test
67
67
- lint
68
68
- commitlint
69
69
70
70
runs-on : ubuntu-latest
71
- environment : release
72
- concurrency : release
73
- permissions :
74
- id-token : write
75
- attestations : write
76
- contents : write
71
+ environment : test_release
72
+ if : github.ref_name != 'main'
77
73
78
74
steps :
79
75
- uses : actions/checkout@v4
@@ -88,16 +84,39 @@ jobs:
88
84
# Do a dry run of PSR
89
85
- name : Test release
90
86
uses : python-semantic-release/python-semantic-release@v9
91
- if : github.ref_name != 'main'
92
87
with :
93
88
root_options : --noop
94
89
github_token : noop
95
90
91
+ release :
92
+ needs :
93
+ - test
94
+ - lint
95
+ - commitlint
96
+
97
+ if : github.ref_name == 'main'
98
+ runs-on : ubuntu-latest
99
+ environment : release
100
+ concurrency : release
101
+ permissions :
102
+ id-token : write
103
+ attestations : write
104
+ contents : write
105
+
106
+ steps :
107
+ - uses : actions/checkout@v4
108
+ with :
109
+ fetch-depth : 0
110
+ ref : ${{ github.sha }}
111
+
112
+ - name : Checkout commit for release
113
+ run : |
114
+ git checkout -B ${{ github.ref_name }} ${{ github.sha }}
115
+
96
116
# On main branch: actual PSR + upload to PyPI & GitHub
97
117
- name : Release
98
118
uses : python-semantic-release/python-semantic-release@v9
99
119
id : release
100
- if : github.ref_name == 'main'
101
120
with :
102
121
github_token : ${{ secrets.GITHUB_TOKEN }}
103
122
You can’t perform that action at this time.
0 commit comments