Skip to content

Commit dc7136a

Browse files
committed
Various updates
1 parent 5f0189c commit dc7136a

File tree

1 file changed

+22
-37
lines changed

1 file changed

+22
-37
lines changed

.github/workflows/update-version-pr.yaml

Lines changed: 22 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,13 @@ jobs:
2727
- name: Checkout
2828
uses: actions/checkout@v4
2929

30-
- name: Ensure jq is installed
31-
run: |
32-
sudo apt-get update
33-
sudo apt-get install -y jq
34-
3530
- name: Read current pin from requirements.txt
3631
id: current
3732
run: |
3833
LINE=$(grep -E '^qiskit-serverless~=' requirements.txt | head -n1 || true)
39-
if [ -z "$LINE" ]; then
40-
echo "Could not find 'qiskit-serverless~=' in requirements.txt" >&2
41-
exit 1
42-
fi
43-
4434
CURR_VER="${LINE#*~=}"
4535
echo "Current pin version: $CURR_VER"
46-
4736
IFS='.' read -r CURR_MAJ CURR_MIN CURR_PAT <<< "$CURR_VER"
48-
4937
echo "curr_major=$CURR_MAJ" >> "$GITHUB_OUTPUT"
5038
echo "curr_minor=$CURR_MIN" >> "$GITHUB_OUTPUT"
5139
echo "curr_patch=$CURR_PAT" >> "$GITHUB_OUTPUT"
@@ -71,7 +59,6 @@ jobs:
7159
| jq -r '.releases | keys[]' \
7260
| grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' \
7361
| sort -V | tail -n1)
74-
7562
if [ -z "$LATEST" ]; then
7663
echo "Failed to determine latest stable version from PyPI." >&2
7764
exit 1
@@ -80,7 +67,6 @@ jobs:
8067
8168
echo "Using latest version: $LATEST"
8269
IFS='.' read -r L_MAJ L_MIN L_PAT <<< "$LATEST"
83-
8470
echo "latest=$LATEST" >> "$GITHUB_OUTPUT"
8571
echo "latest_major=$L_MAJ" >> "$GITHUB_OUTPUT"
8672
echo "latest_minor=$L_MIN" >> "$GITHUB_OUTPUT"
@@ -116,33 +102,30 @@ jobs:
116102
if: steps.decision.outputs.update == 'true'
117103
id: apply
118104
run: |
105+
# Compute new catalog version
106+
OLD_VER=$(tr -d '[:space:]' < qiskit_ibm_catalog/VERSION.txt)
107+
IFS='.' read -r A B C <<< "$OLD_VER"
108+
if [ "$UPDATE_TYPE" = "major" ]; then
109+
NEW_VER="$((A + 1)).0.0"
110+
else
111+
NEW_VER="${A}.$((B + 1)).0"
112+
fi
113+
BRANCH="prepare-${NEW_VER}-release"
114+
115+
# Compute new serverless pin
119116
UPDATE_TYPE="${{ steps.decision.outputs.update_type }}"
120117
LM=${{ steps.pypi.outputs.latest_major }}
121118
Ln=${{ steps.pypi.outputs.latest_minor }}
122-
123119
if [ "$UPDATE_TYPE" = "major" ]; then
124120
NEW_PIN_VER="${LM}.0.0"
125-
BRANCH="release/qiskit-serverless-${LM}.0-major"
126121
else
127122
NEW_PIN_VER="${LM}.${Ln}.0"
128-
BRANCH="release/qiskit-serverless-${LM}.${Ln}-minor"
129123
fi
130124
125+
# Apply updates
131126
echo "Updating pin to qiskit-serverless~=${NEW_PIN_VER}"
132-
133127
sed -i -E "s/^qiskit-serverless~=[0-9]+\.[0-9]+\.[0-9]+/qiskit-serverless~=${NEW_PIN_VER}/" requirements.txt
134-
135-
OLD_VER=$(tr -d '[:space:]' < qiskit_ibm_catalog/VERSION.txt)
136-
IFS='.' read -r A B C <<< "$OLD_VER"
137-
138-
if [ "$UPDATE_TYPE" = "major" ]; then
139-
NEW_VER="$((A + 1)).0.0"
140-
else
141-
NEW_VER="${A}.$((B + 1)).0"
142-
fi
143-
144128
echo "$NEW_VER" > qiskit_ibm_catalog/VERSION.txt
145-
146129
echo "branch=$BRANCH" >> "$GITHUB_OUTPUT"
147130
echo "new_pkg_version=$NEW_VER" >> "$GITHUB_OUTPUT"
148131
echo "new_pin_version=$NEW_PIN_VER" >> "$GITHUB_OUTPUT"
@@ -155,18 +138,20 @@ jobs:
155138
branch: ${{ steps.apply.outputs.branch }}
156139
base: main
157140
title: >
158-
Prepare release: qiskit-serverless → ~=${{ steps.apply.outputs.new_pin_version }},
159-
bump to ${{ steps.apply.outputs.new_pkg_version }}
141+
Prepare ${{ steps.apply.outputs.new_pkg_version }}
160142
body: |
161143
This PR prepares a new release of **qiskit-ibm-catalog**:
162144
163-
- Update requirement: `qiskit-serverless~=${{ steps.apply.outputs.new_pin_version }}`
164145
- Bump catalog version → `${{ steps.apply.outputs.new_pkg_version }}`
165-
- Patch-only upstream updates are ignored
166-
- Upstream **minor** → bump our **minor**
167-
- Upstream **major** → bump our **major**
168-
169-
After merging, push the tag `v${{ steps.apply.outputs.new_pkg_version }}`.
146+
- Update requirement → `qiskit-serverless~=${{ steps.apply.outputs.new_pin_version }}`
147+
- Patch-only updates of `qiskit-serverless` are ignored
148+
149+
To release the package:
150+
151+
- Merge this PR
152+
- Tag with `v${{ steps.apply.outputs.new_pkg_version }}`
153+
- Push the tag `v${{ steps.apply.outputs.new_pkg_version }}`
154+
170155
labels: |
171156
release
172157
automation

0 commit comments

Comments
 (0)