Skip to content

Commit

Permalink
Merge pull request #291 from OpenCOMPES/automation-improvements
Browse files Browse the repository at this point in the history
Fix to release workflow
  • Loading branch information
rettigl authored Nov 21, 2023
2 parents a9c1af8 + 7f3eeaf commit 8cc1c1a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- sed/**/*
- pyproject.toml
- tutorial/**
- .github/workflows/documentation.yml
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ name: Publish to PyPI
# and a release job on every tag push.
# A publish job is executed on every successful prerelease or release job
# And if publish is successful, the version is also updated in the pyproject.toml file and pushed to main branch
# By default, a workflow run that is triggered by a push event will
# not trigger another push event when it pushes changes to the repository.
# Workflow does not trigger itself as it only changes pyproject.toml, which is not in paths for this workflow
# The package is distributed as sed-processor
on:
push:
Expand All @@ -15,7 +14,10 @@ on:
- '*'
paths:
- sed/**/*
- pyproject.toml
- .github/workflows/release.yml
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
prerelease:
if: github.ref == 'refs/heads/main'
Expand Down Expand Up @@ -132,6 +134,13 @@ jobs:
if: always() && (needs.publish.result == 'success')
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- uses: actions/checkout@v3
with:
lfs: true
Expand All @@ -143,15 +152,13 @@ jobs:
name: pyproject
path: sed-processor

# new_branch set for cases when tagging a release
- name: Commit changes
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: 'bump version to ${{ needs.publish.outputs.version }}'
add: pyproject.toml
cwd: sed-processor
new_branch: main
# By default, a workflow run that is triggered by a push event will
# not trigger another push event when it pushes changes to the repository.
# So no problem here.
1 change: 1 addition & 0 deletions .github/workflows/update_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
branches: main
paths:
- pyproject.toml
- .github/workflows/update_dependencies.yml

jobs:
update_dependencies:
Expand Down

0 comments on commit 8cc1c1a

Please sign in to comment.