Skip to content

Commit 8cc1c1a

Browse files
authored
Merge pull request #291 from OpenCOMPES/automation-improvements
Fix to release workflow
2 parents a9c1af8 + 7f3eeaf commit 8cc1c1a

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

.github/workflows/documentation.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- sed/**/*
88
- pyproject.toml
99
- tutorial/**
10+
- .github/workflows/documentation.yml
1011
# Allows you to run this workflow manually from the Actions tab
1112
workflow_dispatch:
1213

.github/workflows/release.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ name: Publish to PyPI
44
# and a release job on every tag push.
55
# A publish job is executed on every successful prerelease or release job
66
# 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
98
# The package is distributed as sed-processor
109
on:
1110
push:
@@ -15,7 +14,10 @@ on:
1514
- '*'
1615
paths:
1716
- 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+
1921
jobs:
2022
prerelease:
2123
if: github.ref == 'refs/heads/main'
@@ -132,6 +134,13 @@ jobs:
132134
if: always() && (needs.publish.result == 'success')
133135
runs-on: ubuntu-latest
134136
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+
135144
- uses: actions/checkout@v3
136145
with:
137146
lfs: true
@@ -143,15 +152,13 @@ jobs:
143152
name: pyproject
144153
path: sed-processor
145154

146-
# new_branch set for cases when tagging a release
147155
- name: Commit changes
156+
env:
157+
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
148158
uses: EndBug/add-and-commit@v9
149159
with:
150160
default_author: github_actions
151161
message: 'bump version to ${{ needs.publish.outputs.version }}'
152162
add: pyproject.toml
153163
cwd: sed-processor
154164
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.

.github/workflows/update_dependencies.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
branches: main
99
paths:
1010
- pyproject.toml
11+
- .github/workflows/update_dependencies.yml
1112

1213
jobs:
1314
update_dependencies:

0 commit comments

Comments
 (0)