File: increase-version-number.yml

package info (click to toggle)
quantlib-swig 1.41-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,284 kB
  • sloc: python: 6,056; java: 1,552; cs: 774; makefile: 243; sh: 22
file content (37 lines) | stat: -rw-r--r-- 1,555 bytes parent folder | download
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
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-SWIG\].*$/AC_INIT([QuantLib-SWIG], [1.${NEXT_MINOR}-dev],/g" configure.ac
        sed -i -e "s/^    version=.*$/    version=\"1.${NEXT_MINOR}-dev\",/g" Python/setup.py
        sed -i -e "s/^Version: .*$/Version: 1.${NEXT_MINOR}/g" R/DESCRIPTION
        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-SWIG
        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>