File: prepare-release.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 (40 lines) | stat: -rw-r--r-- 1,728 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
38
39
40
name: Prepare release
on:
  workflow_dispatch:

jobs:
  update-for-release:
    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}],/g" configure.ac
        sed -i -e "s/^    version=.*$/    version=\"1.${NEXT_MINOR}\",/g" Python/setup.py
        git commit -a -m "Set version to 1.${NEXT_MINOR}"
    - name: Update ChangeLog
      run: |
        git log --pretty=medium --date=rfc --stat --grep='Merge [^p]' --grep='[Mm]erged' --grep='[Pp]ull from' --invert-grep v1.${LATEST_MINOR}... > ChangeLog.txt
        git commit -a -m "Update changelog"
    - uses: peter-evans/create-pull-request@v8
      with:
        token: ${{ secrets.MACHINE_ACCOUNT_PAT }}
        push-to-fork: ${{ vars.MACHINE_ACCOUNT }}/QuantLib-SWIG
        branch: update-version-for-release-${{ github.ref_name }}
        delete-branch: true
        title: 'Set version to 1.${{ env.NEXT_MINOR }} final'
        author: lballabio[bot] <224797326+lballabio-bot@users.noreply.github.com>