Skip to content

Commit 2df9853

Browse files
authored
Merge pull request #38 from ssl-hep/fix/tag-version
Refactor GitHub actions & update tag
2 parents 7ac0064 + 549ff95 commit 2df9853

File tree

3 files changed

+18
-59
lines changed

3 files changed

+18
-59
lines changed

.github/workflows/pypi.yml

Lines changed: 16 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,16 @@ on:
55
types: [released, prereleased]
66

77
jobs:
8-
build:
8+
publish:
99
runs-on: ubuntu-latest
1010

11+
permissions:
12+
id-token: write # required to push with trusted-pypi-token
13+
contents: write #required to push
14+
15+
env:
16+
BRANCH: ${{ github.event.release.target_commitish }}
17+
1118
steps:
1219
- uses: actions/checkout@v4
1320
with:
@@ -47,66 +54,13 @@ jobs:
4754

4855
- name: List contents of wheel
4956
run: python -m zipfile --list dist/servicex_analysis_utils-*.whl
50-
51-
- name: Upload an artifact of dist
52-
uses: actions/upload-artifact@v4
53-
with:
54-
name: dist-gha-artifact
55-
path: dist
56-
57-
publish:
58-
needs: build
59-
runs-on: ubuntu-latest
60-
61-
permissions:
62-
id-token: write # required to push with trusted-pypi-token
6357

64-
steps:
65-
- name: Set up Python 3.12
66-
uses: actions/setup-python@v5
67-
with:
68-
python-version: '3.12'
69-
70-
- name: Download artifact
71-
uses: actions/download-artifact@v4
72-
with:
73-
name: dist-gha-artifact
74-
path: dist
75-
7658
- name: Publish distribution
7759
uses: pypa/gh-action-pypi-publish@v1.12.3
7860
with:
7961
print-hash: true
80-
81-
commit-version-bump:
82-
needs:
83-
- build
84-
- publish
85-
runs-on: ubuntu-latest
86-
permissions:
87-
contents: write # required to push with GITHUB_TOKEN
88-
89-
steps:
90-
- name: Checkout main branch
91-
uses: actions/checkout@v4
92-
with:
93-
ref: main
94-
95-
- name: Set up Python 3.12
96-
uses: actions/setup-python@v5
97-
with:
98-
python-version: '3.12'
9962

100-
- name: Set env
101-
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
102-
103-
- name: Update version to commit
104-
run: |
105-
sed -i 's/^version\s*=\s*".*"/version = "${{ env.RELEASE_VERSION }}"/' pyproject.toml
106-
sed -i '/__version__/ s/__version__\s*=.*/__version__ = "${{ env.RELEASE_VERSION }}"/' servicex_analysis_utils/__init__.py
107-
108-
109-
- name: Commit version change
63+
- name: Commit version change to branch
11064
run: |
11165
git config --local user.name "github-actions[bot]"
11266
git config --local user.email "github-actions[bot]@users.noreply.github.com"
@@ -120,8 +74,13 @@ jobs:
12074
echo "No changes to commit"
12175
fi
12276
123-
- name: Push commit to main
77+
- name: move tag
78+
run: |
79+
git tag -f ${{ env.RELEASE_VERSION }} -m "$(git tag -l --format='%(contents)' ${{ env.RELEASE_VERSION }})"
80+
81+
- name: Push commit to branch & new tag
12482
# GITHUB_TOKEN is automatically provided
12583
run: |
12684
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
127-
git push origin main
85+
git push origin HEAD:$BRANCH
86+
git push origin --force ${{ env.RELEASE_VERSION }}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "servicex_analysis_utils"
7-
version = "1.2.1a2"
7+
version = "1.2.1"
88
description = "A package with analysis tools for ServiceX."
99
authors = [{name = "Artur Cordeiro Oudot Choi", email = "acordeir@cern.ch"}]
1010
readme = "README.md"

servicex_analysis_utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929
from .file_peeking import get_structure
3030
from .dataset_resolver import ds_type_resolver
3131

32-
__version__ = "1.2.1a2"
32+
__version__ = "1.2.1"
3333
__all__ = ["to_awk", "get_structure", "ds_type_resolver"]

0 commit comments

Comments
 (0)