File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: Build and Deploy Java Parser
22
33on :
44 push :
5- branches : [develop]
5+ branches : [develop, main ]
66 tags : ['v*']
77
88jobs :
4848 BASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | sed 's/-SNAPSHOT//')
4949 mvn versions:set -DnewVersion="${BASE_VERSION}-SNAPSHOT" -DgenerateBackupPoms=false
5050
51+ - name : Set release version (main branch)
52+ if : github.ref == 'refs/heads/main'
53+ run : |
54+ cd java
55+ BASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | sed 's/-SNAPSHOT//')
56+ mvn versions:set -DnewVersion="${BASE_VERSION}" -DgenerateBackupPoms=false
57+
5158 - name : Set release version (tag)
5259 if : startsWith(github.ref, 'refs/tags/v')
5360 run : |
7481 MAVEN_GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
7582
7683 - name : Deploy Release to Central Portal
77- if : startsWith(github.ref, 'refs/tags/v')
84+ if : github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
7885 run : cd java && mvn clean deploy
7986 env :
8087 MAVEN_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: Build and Deploy JS Parser
22
33on :
44 push :
5- branches : [develop]
5+ branches : [develop, main ]
66 tags : ['v*']
77
88jobs :
3737 env :
3838 NODE_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN }}
3939
40+ - name : Set release version and publish (main branch)
41+ if : github.ref == 'refs/heads/main'
42+ run : |
43+ cd js
44+ echo "Publishing version: $(node -p "require('./package.json').version")"
45+ npm publish --access public
46+ env :
47+ NODE_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN }}
48+
4049 - name : Set release version and publish (tag)
4150 if : startsWith(github.ref, 'refs/tags/v')
4251 run : |
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: Build and Deploy Python Parser
22
33on :
44 push :
5- branches : [develop]
5+ branches : [develop, main ]
66 tags : ['v*']
77
88jobs :
3131 sed -i "s/version=\"[^\"]*\"/version=\"${DEV_VERSION}\"/" setup.py
3232 echo "Publishing version: ${DEV_VERSION}"
3333
34+ - name : Set release version (main branch)
35+ if : github.ref == 'refs/heads/main'
36+ run : |
37+ cd python
38+ BASE_VERSION=$(grep -oP 'version="\K[0-9]+\.[0-9]+\.[0-9]+' setup.py)
39+ echo "Publishing version: ${BASE_VERSION}"
40+
3441 - name : Set release version (tag)
3542 if : startsWith(github.ref, 'refs/tags/v')
3643 run : |
You can’t perform that action at this time.
0 commit comments