@@ -4,8 +4,7 @@ name: Publish to PyPI
4
4
# and a release job on every tag push.
5
5
# A publish job is executed on every successful prerelease or release job
6
6
# And if publish is successful, the version is also updated in the pyproject.toml file and pushed to main branch
7
- # By default, a workflow run that is triggered by a push event will
8
- # not trigger another push event when it pushes changes to the repository.
7
+ # Workflow does not trigger itself as it only changes pyproject.toml, which is not in paths for this workflow
9
8
# The package is distributed as sed-processor
10
9
on :
11
10
push :
15
14
- ' *'
16
15
paths :
17
16
- sed/**/*
18
- - pyproject.toml
17
+ - .github/workflows/release.yml
18
+ # Allows you to run this workflow manually from the Actions tab
19
+ workflow_dispatch :
20
+
19
21
jobs :
20
22
prerelease :
21
23
if : github.ref == 'refs/heads/main'
@@ -132,6 +134,13 @@ jobs:
132
134
if : always() && (needs.publish.result == 'success')
133
135
runs-on : ubuntu-latest
134
136
steps :
137
+ - name : Generate a token
138
+ id : generate_token
139
+ uses : actions/create-github-app-token@v1
140
+ with :
141
+ app-id : ${{ secrets.APP_ID }}
142
+ private-key : ${{ secrets.APP_PRIVATE_KEY }}
143
+
135
144
- uses : actions/checkout@v3
136
145
with :
137
146
lfs : true
@@ -143,15 +152,13 @@ jobs:
143
152
name : pyproject
144
153
path : sed-processor
145
154
146
- # new_branch set for cases when tagging a release
147
155
- name : Commit changes
156
+ env :
157
+ GITHUB_TOKEN : ${{ steps.generate_token.outputs.token }}
148
158
uses : EndBug/add-and-commit@v9
149
159
with :
150
160
default_author : github_actions
151
161
message : ' bump version to ${{ needs.publish.outputs.version }}'
152
162
add : pyproject.toml
153
163
cwd : sed-processor
154
164
new_branch : main
155
- # By default, a workflow run that is triggered by a push event will
156
- # not trigger another push event when it pushes changes to the repository.
157
- # So no problem here.
0 commit comments