Skip to content

Fix to release workflow #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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