Skip to content
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
73 changes: 16 additions & 57 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@ on:
types: [released, prereleased]

jobs:
build:
publish:
runs-on: ubuntu-latest

permissions:
id-token: write # required to push with trusted-pypi-token
contents: write #required to push

env:
BRANCH: ${{ github.event.release.target_commitish }}

steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -47,66 +54,13 @@ jobs:

- name: List contents of wheel
run: python -m zipfile --list dist/servicex_analysis_utils-*.whl

- name: Upload an artifact of dist
uses: actions/upload-artifact@v4
with:
name: dist-gha-artifact
path: dist

publish:
needs: build
runs-on: ubuntu-latest

permissions:
id-token: write # required to push with trusted-pypi-token

steps:
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Download artifact
uses: actions/download-artifact@v4
with:
name: dist-gha-artifact
path: dist

- name: Publish distribution
uses: pypa/[email protected]
with:
print-hash: true

commit-version-bump:
needs:
- build
- publish
runs-on: ubuntu-latest
permissions:
contents: write # required to push with GITHUB_TOKEN

steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Update version to commit
run: |
sed -i 's/^version\s*=\s*".*"/version = "${{ env.RELEASE_VERSION }}"/' pyproject.toml
sed -i '/__version__/ s/__version__\s*=.*/__version__ = "${{ env.RELEASE_VERSION }}"/' servicex_analysis_utils/__init__.py


- name: Commit version change
- name: Commit version change to branch
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
Expand All @@ -120,8 +74,13 @@ jobs:
echo "No changes to commit"
fi

- name: Push commit to main
- name: move tag
run: |
git tag -f ${{ env.RELEASE_VERSION }} -m "$(git tag -l --format='%(contents)' ${{ env.RELEASE_VERSION }})"

- name: Push commit to branch & new tag
# GITHUB_TOKEN is automatically provided
run: |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git push origin main
git push origin HEAD:$BRANCH
git push origin --force ${{ env.RELEASE_VERSION }}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "servicex_analysis_utils"
version = "1.2.1a2"
version = "1.2.1"
description = "A package with analysis tools for ServiceX."
authors = [{name = "Artur Cordeiro Oudot Choi", email = "[email protected]"}]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion servicex_analysis_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
from .file_peeking import get_structure
from .dataset_resolver import ds_type_resolver

__version__ = "1.2.1a2"
__version__ = "1.2.1"
__all__ = ["to_awk", "get_structure", "ds_type_resolver"]