Skip to content

Update Component Versions #20

Update Component Versions

Update Component Versions #20

name: Update Component Versions
on:
workflow_dispatch:
inputs:
new_version:
description: 'version to update to ("x.y.z" -- do not include a `v` prefix)'
required: true
permissions:
contents: write
pull-requests: write
jobs:
update_component_versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #4.1.7
with:
fetch-depth: 0
fetch-tags: true
- name: Install helm
shell: bash
run: |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
- name: Set variables
shell: bash
run: |
NEWNUM=${{ github.event.inputs.new_version }}
OLDTXT=$(git describe --tags $(git rev-list --tags --max-count=1))
OLDNUM="${OLDTXT:1}"
echo "NEWNUM=$NEWNUM" >> "$GITHUB_ENV"
echo "OLDNUM=$OLDNUM" >> "$GITHUB_ENV"
- name: Update qiskit-serverless chart
shell: bash
run: |
sed -i "s/version: ${OLDNUM}/version: ${NEWNUM}/" charts/qiskit-serverless/Chart.yaml
sed -i "s/appVersion: \"${OLDNUM}\"/appVersion: \"${NEWNUM}\"/" charts/qiskit-serverless/Chart.yaml
sed -i "s/version: ${OLDNUM}/version: ${NEWNUM}/" charts/qiskit-serverless/charts/gateway/Chart.yaml
sed -i "s/appVersion: \"${OLDNUM}\"/appVersion: \"${NEWNUM}\"/" charts/qiskit-serverless/charts/gateway/Chart.yaml
sed -i "s/ray-node:${OLDNUM}/ray-node:${NEWNUM}/" charts/qiskit-serverless/charts/gateway/values.yaml
sed -i "s/qiskit-serverless\/proxy:${OLDNUM}/qiskit-serverless\/proxy:${NEWNUM}/" charts/qiskit-serverless/charts/gateway/values.yaml
sed -i "s/tag: \"${OLDNUM}\"/tag: \"${NEWNUM}\"/" charts/qiskit-serverless/values.yaml
sed -i "s/ray-node:${OLDNUM}/ray-node:${NEWNUM}/" charts/qiskit-serverless/values.yaml
sed -i "s/version: ${OLDNUM}/version: ${NEWNUM}/" charts/qiskit-serverless/values.yaml
sed -i "s/qiskit-serverless\/ray-node:${OLDNUM}/qiskit-serverless\/ray-node:${NEWNUM}/" docs/deployment/custom_function/Sample-Dockerfile
sed -i "s/qiskit-serverless\/ray-node:${OLDNUM}/qiskit-serverless\/ray-node:${NEWNUM}/" gateway/main/settings.py
cd charts/qiskit-serverless
helm dependency update
cd -
- name: Update client version
shell: bash
run: |
sed -i "s/${OLDNUM}/${NEWNUM}/" client/qiskit_serverless/VERSION.txt
- name: Update compose
shell: bash
run: |
sed -i "s/VERSION:-${OLDNUM}/VERSION:-${NEWNUM}/g" docker-compose.yaml
- name: Update docs
shell: bash
run: |
sed -i "s/${OLDNUM}/${NEWNUM}/g" docs/deployment/cloud.rst
sed -i "s/${OLDNUM}-py310/${NEWNUM}/g" docs/deployment/deploying_custom_image_function.rst
- name: Create PR
id: cpr
uses: peter-evans/create-pull-request@cd5c7e4b8bff84befe9c12e7cffbecfda02c7ce9 #6.1.0
with:
branch: "update-version-${{ github.event.inputs.new_version }}"
title: "update-version-${{ github.event.inputs.new_version }}"