-
Notifications
You must be signed in to change notification settings - Fork 4
35 lines (29 loc) · 999 Bytes
/
version.yml
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
name: Increment Version
on:
pull_request:
types: [opened]
jobs:
increment-patch-version:
runs-on: ubuntu-latest
steps:
- name: Cancel previous
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout code
uses: actions/checkout@v2
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Increment patch version
run: |
SYNTH_CC_FILE=$(realpath src)/synth_rapidsilicon.cc
CURR_VERSION=$(grep "VERSION_PATCH" $SYNTH_CC_FILE | grep -Eo '[0-9]*')
let "NEW_VERSION=CURR_VERSION+1"
sed -i "s/VERSION_PATCH $CURR_VERSION/VERSION_PATCH $NEW_VERSION/g" $SYNTH_CC_FILE
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
message: 'Incremented patch version'
committer_name: GitHub Actions
add: 'src/synth_rapidsilicon.cc'