Skip to content

Commit f502d89

Browse files
committed
Update GitHub Actions workflows and streamline deploy
Upgraded actions/checkout, setup-node, and setup-java to v5 in all workflows. Improved deploy workflow by adding permissions, GPG key import, Maven cache, and package publishing steps. Removed redundant publish job from deploy.yml and fixed formatting in codeql-analysis.yml.
1 parent 7da5731 commit f502d89

File tree

3 files changed

+73
-92
lines changed

3 files changed

+73
-92
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,20 @@ on:
1616
jobs:
1717
build:
1818
runs-on: ubuntu-latest
19-
services:
20-
solr:
21-
image: viglet/turing-solr:0.3.7
22-
ports:
23-
- 8983:8983
2419
steps:
25-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v5
2621
with:
2722
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
2823

2924
- name: Use Node.js 18.10.0
30-
uses: actions/setup-node@v1
25+
uses: actions/setup-node@v5
3126
with:
3227
node-version: 18.10.0
3328
- name: Install Angular Cli
3429
run: npm i -g @angular/cli
3530

3631
- name: Set up JDK 21
37-
uses: actions/setup-java@v3
32+
uses: actions/setup-java@v5
3833
with:
3934
java-version: "21"
4035
distribution: "zulu"

.github/workflows/codeql-analysis.yml

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ name: "CodeQL Advanced"
1313

1414
on:
1515
push:
16-
branches: [ "2025.3" ]
16+
branches: ["2025.3"]
1717
pull_request:
18-
branches: [ "2025.3" ]
18+
branches: ["2025.3"]
1919
schedule:
20-
- cron: '28 17 * * 3'
20+
- cron: "28 17 * * 3"
2121

2222
jobs:
2323
analyze:
@@ -43,10 +43,10 @@ jobs:
4343
fail-fast: false
4444
matrix:
4545
include:
46-
- language: java-kotlin
47-
build-mode: none # This mode only analyzes Java. Set this to 'autobuild' or 'manual' to analyze Kotlin too.
48-
- language: javascript-typescript
49-
build-mode: none
46+
- language: java-kotlin
47+
build-mode: none # This mode only analyzes Java. Set this to 'autobuild' or 'manual' to analyze Kotlin too.
48+
- language: javascript-typescript
49+
build-mode: none
5050
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
5151
# Use `c-cpp` to analyze code written in C, C++ or both
5252
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
@@ -56,39 +56,39 @@ jobs:
5656
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
5757
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
5858
steps:
59-
- name: Checkout repository
60-
uses: actions/checkout@v4
59+
- name: Checkout repository
60+
uses: actions/checkout@v5
6161

62-
# Initializes the CodeQL tools for scanning.
63-
- name: Initialize CodeQL
64-
uses: github/codeql-action/init@v3
65-
with:
66-
languages: ${{ matrix.language }}
67-
build-mode: ${{ matrix.build-mode }}
68-
# If you wish to specify custom queries, you can do so here or in a config file.
69-
# By default, queries listed here will override any specified in a config file.
70-
# Prefix the list here with "+" to use these queries and those in the config file.
62+
# Initializes the CodeQL tools for scanning.
63+
- name: Initialize CodeQL
64+
uses: github/codeql-action/init@v3
65+
with:
66+
languages: ${{ matrix.language }}
67+
build-mode: ${{ matrix.build-mode }}
68+
# If you wish to specify custom queries, you can do so here or in a config file.
69+
# By default, queries listed here will override any specified in a config file.
70+
# Prefix the list here with "+" to use these queries and those in the config file.
7171

72-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
73-
# queries: security-extended,security-and-quality
72+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
73+
# queries: security-extended,security-and-quality
7474

75-
# If the analysis step fails for one of the languages you are analyzing with
76-
# "We were unable to automatically build your code", modify the matrix above
77-
# to set the build mode to "manual" for that language. Then modify this step
78-
# to build your code.
79-
# ℹ️ Command-line programs to run using the OS shell.
80-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
81-
- if: matrix.build-mode == 'manual'
82-
shell: bash
83-
run: |
84-
echo 'If you are using a "manual" build mode for one or more of the' \
85-
'languages you are analyzing, replace this with the commands to build' \
86-
'your code, for example:'
87-
echo ' make bootstrap'
88-
echo ' make release'
89-
exit 1
75+
# If the analysis step fails for one of the languages you are analyzing with
76+
# "We were unable to automatically build your code", modify the matrix above
77+
# to set the build mode to "manual" for that language. Then modify this step
78+
# to build your code.
79+
# ℹ️ Command-line programs to run using the OS shell.
80+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
81+
- if: matrix.build-mode == 'manual'
82+
shell: bash
83+
run: |
84+
echo 'If you are using a "manual" build mode for one or more of the' \
85+
'languages you are analyzing, replace this with the commands to build' \
86+
'your code, for example:'
87+
echo ' make bootstrap'
88+
echo ' make release'
89+
exit 1
9090
91-
- name: Perform CodeQL Analysis
92-
uses: github/codeql-action/analyze@v3
93-
with:
94-
category: "/language:${{matrix.language}}"
91+
- name: Perform CodeQL Analysis
92+
uses: github/codeql-action/analyze@v3
93+
with:
94+
category: "/language:${{matrix.language}}"

.github/workflows/deploy.yml

Lines changed: 31 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ on:
1515
jobs:
1616
build:
1717
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
packages: write
1821
steps:
19-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v5
2023
with:
2124
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
22-
2325
- name: Use Node.js 18.10.0
24-
uses: actions/setup-node@v1
26+
uses: actions/setup-node@v5
2527
with:
2628
node-version: 18.10.0
2729
registry-url: "https://registry.npmjs.org"
@@ -30,11 +32,25 @@ jobs:
3032
run: npm i -g @angular/cli
3133

3234
- name: Set up JDK 21
33-
uses: actions/setup-java@v3
35+
uses: actions/setup-java@v5
3436
with:
3537
java-version: "21"
3638
distribution: "temurin"
3739
cache: maven
40+
- name: Import GPG key
41+
run: |
42+
echo "$GPG_PRIVATE_KEY" > private.key
43+
gpg --batch --import private.key
44+
gpg --list-secret-keys
45+
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
46+
env:
47+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
48+
- name: Cache Maven packages
49+
uses: actions/cache@v4
50+
with:
51+
path: ~/.m2
52+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
53+
restore-keys: ${{ runner.os }}-m2
3854
- name: Increment Version
3955
run: |
4056
mvn build-helper:parse-version versions:set -Dgpg.skip=true -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} versions:commit
@@ -45,12 +61,17 @@ jobs:
4561
git config user.email [email protected]
4662
git commit -m "Updated version in pom.xml" -a
4763
git push
48-
- name: Cache Maven packages
49-
uses: actions/cache@v3
50-
with:
51-
path: ~/.m2
52-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
53-
restore-keys: ${{ runner.os }}-m2
64+
- name: Publish package
65+
run: |
66+
mvn --batch-mode -pl turing-commons,turing-java-sdk,turing-aem-commons -P release -am deploy -Dgpg.passphrase="${GPG_PASSPHRASE}"
67+
# cd turing-js-sdk/js-sdk-lib
68+
# npm publish
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
72+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
73+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
74+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
5475
- name: Deploy Version
5576
env:
5677
GH_TOKEN: ${{ github.token }}
@@ -67,41 +88,6 @@ jobs:
6788
gh release upload ${TAG_NAME} turing-java-sdk/target/turing-java-sdk.jar --clobber
6889
gh release upload ${TAG_NAME} turing-commons/target/turing-commons.jar --clobber
6990
gh release upload ${TAG_NAME} turing-utils/target/turing-utils.zip --clobber
70-
71-
publish:
72-
runs-on: ubuntu-latest
73-
permissions:
74-
contents: write
75-
packages: write
76-
steps:
77-
- uses: actions/checkout@v4
78-
- name: Set up Java for publishing to Maven Central Repository
79-
uses: actions/setup-java@v4
80-
with:
81-
java-version: "21"
82-
distribution: "temurin"
83-
server-id: central
84-
server-username: MAVEN_USERNAME
85-
server-password: MAVEN_PASSWORD
86-
- name: Import GPG key
87-
run: |
88-
echo "$GPG_PRIVATE_KEY" > private.key
89-
gpg --batch --import private.key
90-
gpg --list-secret-keys
91-
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
92-
env:
93-
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
94-
- name: Publish package
95-
run: |
96-
mvn --batch-mode -pl turing-commons,turing-java-sdk,turing-aem-commons -P release -am deploy -Dgpg.passphrase="${GPG_PASSPHRASE}"
97-
# cd turing-js-sdk/js-sdk-lib
98-
# npm publish
99-
env:
100-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
102-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
103-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
104-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
10591
- name: Deploy JavaDoc 🚀
10692
uses: MathieuSoysal/[email protected]
10793
with:

0 commit comments

Comments
 (0)