Skip to content
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

DEV: Release using the REL commit instead of git tag #2500

Merged
merged 7 commits into from
Mar 29, 2024
Merged
Changes from 1 commit
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
20 changes: 18 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,34 @@
name: Publish Python Package to PyPI
on:
push:
tags:
- '*.*.*'
branches:
- main
MartinThoma marked this conversation as resolved.
Show resolved Hide resolved

jobs:
build_and_publish:
name: Publish a new version of pypdf
runs-on: ubuntu-latest
if: "startsWith(${{ github.event.head_commit.message}}, 'REL: ')"
MartinThoma marked this conversation as resolved.
Show resolved Hide resolved

steps:
# Ensure it's on PyPI
- name: Checkout Repository
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
MartinThoma marked this conversation as resolved.
Show resolved Hide resolved
- name: Extract version from commit message
id: extract_version
run: |
VERSION=$(echo "${{ github.event.head_commit.message }}" | grep -oP '(?<=REL: )\d+\.\d+\.\d+')
echo "::set-output name=version::$VERSION"
MartinThoma marked this conversation as resolved.
Show resolved Hide resolved

MartinThoma marked this conversation as resolved.
Show resolved Hide resolved
- name: Create Git Tag
run: |
VERSION="${{ steps.extract_version.outputs.version }}"
git config user.name github-actions
MartinThoma marked this conversation as resolved.
Show resolved Hide resolved
git config user.email github-actions@github.com
git tag "$VERSION" -m "${{ github.event.head_commit.message }}"
MartinThoma marked this conversation as resolved.
Show resolved Hide resolved
git push origin $VERSION

- name: Set up Python
uses: actions/setup-python@v5
Expand Down
Loading