1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
name: Increase version number
on:
workflow_dispatch:
jobs:
increase-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Setup git
run: |
git config user.name 'lballabio[bot]'
git config user.email '224797326+lballabio-bot@users.noreply.github.com'
- name: Calculate versions
env:
GH_TOKEN: ${{ github.token }}
run: |
export LATEST_RELEASE=`gh release list --json name,isLatest --jq '.[] | select(.isLatest)|.name'`
echo ${LATEST_RELEASE} | awk -F '.' '{ print "LATEST_MINOR=" $2 }' | tee -a $GITHUB_ENV
echo ${LATEST_RELEASE} | awk -F '.' '{ print "NEXT_MINOR=" $2 + 1 }' | tee -a $GITHUB_ENV
- name: Update version numbers
run: |
sed -i -e "s/^AC_INIT(\[QuantLib\].*$/AC_INIT([QuantLib], [1.${NEXT_MINOR}-dev],/g" configure.ac
sed -i -e "s/^#define QL_VERSION.*$/#define QL_VERSION \"1.${NEXT_MINOR}-dev\"/g" ql/version.hpp
sed -i -e "s/^#define QL_HEX_VERSION.*$/#define QL_HEX_VERSION 0x01${NEXT_MINOR}0000/g" ql/version.hpp
sed -i -e "s/^set(QUANTLIB_VERSION_MINOR .*$/set(QUANTLIB_VERSION_MINOR ${NEXT_MINOR})/g" CMakeLists.txt
sed -i -e "s/^set(PACKAGE_VERSION .*$/set(PACKAGE_VERSION \"1.${NEXT_MINOR}-dev\"\)/g" CMakeLists.txt
sed -i -e "s/^set(PACKAGE_VERSION_HEX.*$/set(PACKAGE_VERSION_HEX \"0x01${NEXT_MINOR}0000\"\)/g" CMakeLists.txt
git commit -a -m "Set version to 1.${NEXT_MINOR}-dev"
- uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.MACHINE_ACCOUNT_PAT }}
push-to-fork: ${{ vars.MACHINE_ACCOUNT }}/QuantLib
branch: set-to-rc-${{ github.ref_name }}
delete-branch: true
title: 'Set version to 1.${{ env.NEXT_MINOR }}-dev'
author: lballabio[bot] <224797326+lballabio-bot@users.noreply.github.com>
|