@@ -24,39 +24,39 @@ jobs:
2424 permissions :
2525 contents : read
2626 packages : write
27-
27+
2828 steps :
2929 - name : Checkout code
3030 uses : actions/checkout@v4
31-
31+
3232 - name : Set up JDK 21
3333 uses : actions/setup-java@v4
3434 with :
3535 java-version : ' 21'
3636 distribution : ' temurin'
37-
37+
3838 - name : Set up Node.js
3939 uses : actions/setup-node@v4
4040 with :
4141 node-version : ' 20'
4242 registry-url : ' https://npm.pkg.github.com'
4343 scope : ' @trustification'
44-
44+
4545 - name : Cache Maven packages
4646 uses : actions/cache@v4
4747 with :
4848 path : ~/.m2
4949 key : ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
5050 restore-keys : ${{ runner.os }}-m2
51-
51+
5252 - name : Cache npm dependencies
5353 uses : actions/cache@v4
5454 with :
5555 path : ~/.npm
5656 key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
5757 restore-keys : |
5858 ${{ runner.os }}-node-
59-
59+
6060 - name : Get API version
6161 id : api-version
6262 run : |
@@ -65,40 +65,43 @@ jobs:
6565 else
6666 echo "version=v1" >> $GITHUB_OUTPUT
6767 fi
68-
68+
6969 - name : Build and Release Java Models
7070 if : ${{ github.event.inputs.release_java != 'false' }}
7171 run : |
72- echo "📦 Building and releasing Java models..."
73- cd api-models/java
74- # Set the release version
75- mvn versions:set -DnewVersion=${{ steps.api-version.outputs.version }} -DgenerateBackupPoms=false
76- mvn clean generate-sources compile -Dapi.version=${{ steps.api-version.outputs.version }}
77- mvn deploy -Dapi.version=${{ steps.api-version.outputs.version }}
78- # Reset to SNAPSHOT version
79- mvn versions:set -DnewVersion=1.0.0-SNAPSHOT -DgenerateBackupPoms=false
80- echo "✅ Java models released successfully"
81- env:
82- GITHUB_ACTOR: ${{ github.actor }}
83- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84-
72+ echo "📦 Building and releasing Java models..."
73+ cd api-models/java
74+ # Set the release version (convert v1 to 1.0.0 format)
75+ RELEASE_VERSION="1.0.0-${{ steps.api-version.outputs.version }}"
76+ mvn versions:set -DnewVersion=$RELEASE_VERSION -DgenerateBackupPoms=false
77+ mvn clean generate-sources compile -Dapi.version=${{ steps.api-version.outputs.version }}
78+ mvn deploy -Dapi.version=${{ steps.api-version.outputs.version }}
79+ # Reset to SNAPSHOT version
80+ mvn versions:set -DnewVersion=1.0.0-SNAPSHOT -DgenerateBackupPoms=false
81+ echo "✅ Java models released successfully"
82+ env :
83+ GITHUB_ACTOR : ${{ github.actor }}
84+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
85+
8586 - name : Build and Release TypeScript Models
8687 if : ${{ github.event.inputs.release_typescript != 'false' }}
8788 run : |
88- echo "📦 Building and releasing TypeScript models..."
89- cd api-models/typescript
90- # Set the release version
91- npm version ${{ steps.api-version.outputs.version }} --no-git-tag-version
92- npm ci
93- npm run generate --version ${{ steps.api-version.outputs.version }}
94- npm run build
95- npm publish
96- # Reset to SNAPSHOT version
97- npm version 1.0.0-SNAPSHOT --no-git-tag-version
98- echo "✅ TypeScript models released successfully"
99- env:
100- NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101-
89+ echo "📦 Building and releasing TypeScript models..."
90+ cd api-models/typescript
91+ # Set the release version (convert v1 to 1.0.0 format)
92+ RELEASE_VERSION="1.0.0-${{ steps.api-version.outputs.version }}"
93+ npm version $RELEASE_VERSION --no-git-tag-version
94+ npm ci
95+ npm run generate --version=${{ steps.api-version.outputs.version }}
96+ npm run build
97+ npm publish
98+ # Reset to SNAPSHOT version
99+ npm version 1.0.0-SNAPSHOT --no-git-tag-version
100+ echo "✅ TypeScript models released successfully"
101+ env :
102+ NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
103+ npm_config_version : ${{ steps.api-version.outputs.version }}
104+
102105 - name : Summary
103106 run : |
104107 echo "🎉 API Models release completed!"
0 commit comments