File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 paths-ignore :
2222 - ' **/*.md'
2323 - ' .github/*.yml'
24+ - ' .github/workflows/bump-version.yml'
2425 - ' .github/workflows/licensecheck.yml'
2526 - ' .github/workflows/validate_pr.yml'
2627 - ' **/.project'
Original file line number Diff line number Diff line change 1+ # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
2+ name : Bump Version
3+
4+ on :
5+ workflow_dispatch :
6+ # https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
7+ inputs :
8+ type :
9+ description : Type
10+ default : micro'
11+ required : true
12+ type : choice
13+ options :
14+ - major
15+ - minor
16+ - micro
17+
18+
19+ defaults :
20+ run :
21+ shell : bash
22+
23+
24+ jobs :
25+
26+ # ##########################################################
27+ bump-version :
28+ # ##########################################################
29+ runs-on : ubuntu-latest
30+
31+ steps :
32+ - name : " Show: GitHub context"
33+ env :
34+ GITHUB_CONTEXT : ${{ toJSON(github) }}
35+ run : echo $GITHUB_CONTEXT
36+
37+
38+ - name : " Show: environment variables"
39+ run : env | sort
40+
41+
42+ - name : Git Checkout
43+ uses : actions/checkout@v4 # https://github.com/actions/checkout
44+ with :
45+ fetch-depth : 0 # required to prevent tycho-p2-extras-plugin:compare-version-with-baseline potentially failing the build
46+
47+ - name : Bump Version
48+ run : python bump-version.py ${{ github.event.inputs.type }}
49+
50+ - name : Configure Git
51+ run : |
52+ git config user.name "github-actions[bot]"
53+ git config user.email "github-actions[bot]@users.noreply.github.com"
54+
55+ - name : Commit changes
56+ run : |
57+ git add .
58+
59+ projectVersion=$(python -c "import xml.etree.ElementTree as ET; \
60+ print(ET.parse(open('pom.xml')).getroot().find( \
61+ '{http://maven.apache.org/POM/4.0.0}version').text)")
62+
63+ git commit -m "set tm4e version to $projectVersion"
64+
65+ - name : Push changes
66+ env :
67+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
68+ run : |
69+ git push origin HEAD:${{ github.ref_name }}
You can’t perform that action at this time.
0 commit comments