Skip to content

Commit fd4810e

Browse files
jagalindoJose Angelvlamas
authored
chore: release version 2.5.0 (#71)
* fix(ci): add Java 21 setup to workflow * fix(ci): migrate Java publishing to Central Portal - Replace OSSRH with Central Publishing Portal (OSSRH EOL June 2025) - Update pom.xml to use central-publishing-maven-plugin - Configure tokenAuth for Central Portal authentication - Simplify workflow using setup-java credential management * ci: update gpg signature for java * ci: update gpg signature for java * ci: update gpg signature for java * fix: protecting the main branch and pr will create the new releases after testing * feat: addind a basic test suite * fix: solve issues with python parser testsuite * fix: fix testing issues * fix: fix testing issues * fix: fix testing issues * fix: fix testing issues * fix: fix testing issues * fix: fix testing issues * fix: fix testing issues * fix: fix testing issues * fix: fix testing issues * chore: bump version to 2.5.0 * chore: bump Java and JS versions to 2.5.0 * fix: updating node action to avoid the token use * fix: correcting issue with antlr * fix: correcting issue with node * fix: update permissions to ensure contents are readable * fix: update Node.js version to 24 in workflow * fix: add repository information to package.json * chore: bump Java and JS parser versions to 0.5.0 --------- Co-authored-by: Jose Angel <jagalindo@MacBook-de-test.local> Co-authored-by: vlamas <vlamas@udc.es>
1 parent 6fed501 commit fd4810e

108 files changed

Lines changed: 5636 additions & 65 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/settings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
http://maven.apache.org/xsd/settings-1.0.0.xsd">
55
<servers>
66
<server>
7-
<id>ossrh</id>
7+
<id>central</id>
88
<username>${env.SONATYPE_USERNAME}</username>
99
<password>${env.SONATYPE_PASSWORD}</password>
1010
</server>

.github/workflows/conventionalpr.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ jobs:
88
conventional_commit:
99
name: Conventional Commits
1010
runs-on: ubuntu-latest
11+
permissions:
12+
pull-requests: read
1113
steps:
12-
- uses: actions/checkout@v2
13-
- uses: webiny/action-conventional-commits@v1.0.3
14+
- uses: webiny/action-conventional-commits@v1.3.0
15+
with:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/java.yml

Lines changed: 44 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build and Deploy Java Parser
22

33
on:
44
push:
5-
branches: [develop]
5+
branches: [develop, main]
66
tags: ['v*']
77

88
jobs:
@@ -13,17 +13,33 @@ jobs:
1313
- name: Checkout code
1414
uses: actions/checkout@v4
1515

16-
- name: Install ANTLR4 and Maven
16+
- name: Set up Java 21
17+
uses: actions/setup-java@v4
18+
with:
19+
distribution: 'temurin'
20+
java-version: '21'
21+
server-id: central
22+
server-username: MAVEN_USERNAME
23+
server-password: MAVEN_PASSWORD
24+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
25+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
26+
27+
- name: Configure GPG for batch mode
1728
run: |
18-
sudo apt-get update
19-
sudo apt-get install -y maven
20-
make dev
29+
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
30+
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
31+
gpgconf --kill gpg-agent
2132
22-
- name: Import GPG key
23-
uses: crazy-max/ghaction-import-gpg@v6
24-
with:
25-
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
26-
passphrase: ${{ secrets.GPG_PASSPHRASE }}
33+
- name: Verify GPG key
34+
run: |
35+
gpg --list-secret-keys
36+
echo "Testing GPG signing..."
37+
echo "test" | gpg --batch --pinentry-mode loopback --passphrase "$MAVEN_GPG_PASSPHRASE" --clearsign > /dev/null && echo "GPG signing works!"
38+
env:
39+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
40+
41+
- name: Install ANTLR4
42+
run: make dev
2743

2844
- name: Set SNAPSHOT version (develop branch)
2945
if: github.ref == 'refs/heads/develop'
@@ -32,6 +48,13 @@ jobs:
3248
BASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | sed 's/-SNAPSHOT//')
3349
mvn versions:set -DnewVersion="${BASE_VERSION}-SNAPSHOT" -DgenerateBackupPoms=false
3450
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+
3558
- name: Set release version (tag)
3659
if: startsWith(github.ref, 'refs/tags/v')
3760
run: |
@@ -49,18 +72,18 @@ jobs:
4972
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
5073
restore-keys: ${{ runner.os }}-m2
5174

52-
- name: Deploy SNAPSHOT to OSSRH (develop branch)
75+
- name: Deploy SNAPSHOT to Sonatype Snapshots
5376
if: github.ref == 'refs/heads/develop'
54-
run: cd java && mvn clean deploy --settings ../.github/settings.xml
77+
run: cd java && mvn clean deploy -DskipCentralPublishing=true
5578
env:
56-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
57-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
58-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
79+
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
80+
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
81+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
5982

60-
- name: Deploy Release to Maven Central (tag)
61-
if: startsWith(github.ref, 'refs/tags/v')
62-
run: cd java && mvn clean deploy --settings ../.github/settings.xml
83+
- name: Deploy Release to Central Portal
84+
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
85+
run: cd java && mvn clean deploy
6386
env:
64-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
65-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
66-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
87+
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
88+
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
89+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

.github/workflows/js.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ name: Build and Deploy JS Parser
22

33
on:
44
push:
5-
branches: [develop]
5+
branches: [develop, main]
66
tags: ['v*']
77

88
jobs:
99
build:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write # Required for OIDC trusted publishing
13+
contents: read
1114

1215
steps:
1316
- name: Checkout code
@@ -16,7 +19,7 @@ jobs:
1619
- name: Setup Node
1720
uses: actions/setup-node@v4
1821
with:
19-
node-version: 20
22+
node-version: 24
2023
registry-url: https://registry.npmjs.org/
2124

2225
- name: Install ANTLR4
@@ -33,9 +36,14 @@ jobs:
3336
cd js
3437
npm version --no-git-tag-version "$(node -p "require('./package.json').version")-dev.${GITHUB_RUN_NUMBER}"
3538
echo "Publishing version: $(node -p "require('./package.json').version")"
36-
npm publish --tag dev --access public
37-
env:
38-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
39+
npm publish --tag dev --access public --provenance
40+
41+
- name: Set release version and publish (main branch)
42+
if: github.ref == 'refs/heads/main'
43+
run: |
44+
cd js
45+
echo "Publishing version: $(node -p "require('./package.json').version")"
46+
npm publish --access public --provenance
3947
4048
- name: Set release version and publish (tag)
4149
if: startsWith(github.ref, 'refs/tags/v')
@@ -44,6 +52,4 @@ jobs:
4452
TAG_VERSION=${GITHUB_REF_NAME#v}
4553
npm version --no-git-tag-version "${TAG_VERSION}"
4654
echo "Publishing version: ${TAG_VERSION}"
47-
npm publish --access public
48-
env:
49-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
55+
npm publish --access public --provenance

.github/workflows/python.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build and Deploy Python Parser
22

33
on:
44
push:
5-
branches: [develop]
5+
branches: [develop, main]
66
tags: ['v*']
77

88
jobs:
@@ -31,6 +31,13 @@ jobs:
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: |

.github/workflows/test.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Run Grammar Tests
2+
3+
on:
4+
push:
5+
branches: ['*']
6+
pull_request:
7+
branches: [develop, main]
8+
9+
jobs:
10+
test-javascript:
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
working-directory: js
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
22+
- name: Install ANTLR4
23+
run: cd .. && make dev
24+
25+
- name: Build grammar
26+
run: cd .. && make js_parser
27+
28+
- name: Install dependencies
29+
run: npm install
30+
31+
- name: Run tests
32+
run: npm test
33+
34+
test-python:
35+
runs-on: ubuntu-latest
36+
defaults:
37+
run:
38+
working-directory: python
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- uses: actions/setup-python@v5
43+
with:
44+
python-version: '3.11'
45+
46+
- name: Install ANTLR4
47+
run: cd .. && make dev
48+
49+
- name: Build grammar
50+
run: cd .. && make python_parser
51+
52+
- name: Install dependencies
53+
run: |
54+
pip install antlr4-python3-runtime==4.13.2
55+
pip install -r requirements-dev.txt
56+
57+
- name: Run tests
58+
run: PYTHONPATH=. pytest test_grammar.py -v
59+
60+
test-java:
61+
runs-on: ubuntu-latest
62+
defaults:
63+
run:
64+
working-directory: java
65+
steps:
66+
- uses: actions/checkout@v4
67+
68+
- uses: actions/setup-java@v4
69+
with:
70+
distribution: 'temurin'
71+
java-version: '21'
72+
73+
- name: Install ANTLR4
74+
run: cd .. && make dev
75+
76+
- name: Cache Maven packages
77+
uses: actions/cache@v4
78+
with:
79+
path: ~/.m2
80+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
81+
restore-keys: ${{ runner.os }}-m2
82+
83+
- name: Run tests
84+
run: mvn test

.gitignore

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,54 @@
1-
# VSCode, Eclipse, and IntelliJ IDEA project files
2-
.vscode
3-
.settings
1+
# OS files
2+
.DS_Store
3+
Thumbs.db
4+
5+
# IDEs and editors
6+
.vscode/
7+
.settings/
48
.classpath
59
.project
6-
.idea
10+
.idea/
11+
*.iml
12+
*.swp
13+
*.swo
14+
*~
15+
16+
# Java
17+
target/
18+
*.class
19+
*.jar
20+
*.war
21+
.antlr/
722

8-
# Python virtual environments
9-
env
10-
build
11-
python/uvl/__pycache__
23+
# Python
24+
__pycache__/
25+
*.py[cod]
26+
*$py.class
27+
*.so
28+
.Python
29+
env/
30+
venv/
31+
.venv/
32+
build/
33+
dist/
34+
*.egg-info/
35+
.eggs/
36+
.pytest_cache/
37+
.coverage
38+
htmlcov/
1239
python/uvl/*
40+
!python/uvl/__init__.py
1341
!python/uvl/UVLCustomLexer.py
1442

15-
# Node.js
16-
js/node_modules
43+
# JavaScript
44+
node_modules/
45+
js/node_modules/
1746
js/package-lock.json
47+
js/src/lib/
48+
*.log
49+
npm-debug.log*
1850

19-
# Java build files
20-
.antlr/
21-
target/
51+
# Environment files
52+
.env
53+
.env.local
54+
.env.*.local

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ java_parser:
1616
js_parser:
1717
mkdir -p $(JAVASCRIPT_OUTPUT_DIR)
1818
cd uvl/JavaScript && \
19-
antlr4 $(LIB_FLAG) $(ROOT_DIR)/$(LIB_PATH) -Dlanguage=JavaScript -o $(ROOT_DIR)/$(JAVASCRIPT_OUTPUT_DIR) UVLJavaScriptLexer.g4 UVLJavaScriptParser.g4
19+
ANTLR4_TOOLS_ANTLR_VERSION=4.13.2 antlr4 $(LIB_FLAG) $(ROOT_DIR)/$(LIB_PATH) -Dlanguage=JavaScript -o $(ROOT_DIR)/$(JAVASCRIPT_OUTPUT_DIR) UVLJavaScriptLexer.g4 UVLJavaScriptParser.g4
2020

2121
python_parser:
2222
cd uvl/Python && \
23-
antlr4 $(LIB_FLAG) $(ROOT_DIR)/$(LIB_PATH) -Dlanguage=Python3 -o $(ROOT_DIR)/$(PYTHON_OUTPUT_DIR) UVLPythonLexer.g4 UVLPythonParser.g4
23+
ANTLR4_TOOLS_ANTLR_VERSION=4.13.2 antlr4 $(LIB_FLAG) $(ROOT_DIR)/$(LIB_PATH) -Dlanguage=Python3 -o $(ROOT_DIR)/$(PYTHON_OUTPUT_DIR) UVLPythonLexer.g4 UVLPythonParser.g4
2424

2525
python_prepare_package:
2626
cd python && python3 -m build

0 commit comments

Comments
 (0)