Skip to content

Commit 6661e60

Browse files
Updating ast-cli version and binaries 2.3.54 (#485)
* Updating ast-cli version and binaries * Harden workflows: scope permissions, fix set-output, replace dev-drprasad, remove repository_dispatch, comment notify and spotbugs * Remove Maven cache from release and CI workflows * Add publish input to gate Maven Central deploy --------- Co-authored-by: Luís Ventuzelos <207163323+cx-luis-ventuzelos@users.noreply.github.com>
1 parent 06b449c commit 6661e60

9 files changed

Lines changed: 68 additions & 65 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ jobs:
2121
- name: Checkout LFS objects
2222
run: git lfs checkout
2323

24-
- name: Cache local Maven repository
25-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
26-
with:
27-
path: ~/.m2/repository
28-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
29-
restore-keys: |
30-
${{ runner.os }}-maven-
31-
3224
- name: Set up JDK 11
3325
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4.3.0
3426
with:
@@ -82,8 +74,8 @@ jobs:
8274
- name: Build with Maven
8375
run: mvn -B verify -DskipTests -Dgpg.skip --file pom.xml
8476

85-
- name: Run SpotBugs Analysis
86-
if: ${{ github.actor != 'dependabot[bot]' }}
87-
uses: jwgmeligmeyling/spotbugs-github-action@b8e2c3523acb34c87f14e18cbcd2d87db8c8584e #v1.2
88-
with:
89-
path: '**/spotbugsXml.xml'
77+
# - name: Run SpotBugs Analysis
78+
# if: ${{ github.actor != 'dependabot[bot]' }}
79+
# uses: jwgmeligmeyling/spotbugs-github-action@b8e2c3523acb34c87f14e18cbcd2d87db8c8584e #v1.2
80+
# with:
81+
# path: '**/spotbugsXml.xml'

.github/workflows/nightly.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,24 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
delete_tag:
13+
permissions:
14+
contents: write
1015
runs-on: cx-public-ubuntu-x64
1116
steps:
12-
- name: Delete release
13-
uses: dev-drprasad/delete-tag-and-release@8cd619d00037e4aeb781909c9a6b03940507d0da # v1.0.1
17+
- name: Delete release and tag
1418
env:
15-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16-
with:
17-
delete_release: true
18-
tag_name: 1.0.0-SNAPSHOT
19+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
run: |
21+
gh release delete "1.0.0-SNAPSHOT" --yes --cleanup-tag --repo ${{ github.repository }} || true
22+
1923
nightly:
2024
needs: delete_tag
21-
uses: CheckmarxDev/ast-cli-java-wrapper/.github/workflows/release.yml@main
25+
uses: Checkmarx/ast-cli-java-wrapper/.github/workflows/release.yml@main
2226
with:
2327
tag: "1.0.0-SNAPSHOT"
2428
dev: true

.github/workflows/release.yml

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ on:
1616
description: 'Version of the CLI to bundle'
1717
required: false
1818
type: string
19+
publish:
20+
description: 'Publish package to Maven Central'
21+
required: false
22+
default: false
23+
type: boolean
1924
workflow_call:
2025
inputs:
2126
tag:
@@ -31,9 +36,20 @@ on:
3136
description: 'Version of the CLI to bundle'
3237
required: false
3338
type: string
39+
publish:
40+
description: 'Publish package to Maven Central'
41+
required: false
42+
default: false
43+
type: boolean
44+
45+
permissions:
46+
contents: read
3447

3548
jobs:
3649
release:
50+
permissions:
51+
id-token: write
52+
contents: write
3753
runs-on: cx-public-ubuntu-x64
3854
outputs:
3955
CLI_VERSION: ${{ steps.extract_cli_version.outputs.CLI_VERSION }}
@@ -57,7 +73,7 @@ jobs:
5773
CLI_VERSION=$(./src/main/resources/cx-linux version | grep -Eo '^[0-9]+\.[0-9]+\.[0-9]+')
5874
echo "CLI version being packed is $CLI_VERSION"
5975
echo "CLI_VERSION=$CLI_VERSION" >> $GITHUB_ENV
60-
echo "::set-output name=CLI_VERSION::$CLI_VERSION"
76+
echo "CLI_VERSION=$CLI_VERSION" >> $GITHUB_OUTPUT
6177
6278
- name: Check if CLI version is latest
6379
if: ${{ github.event.inputs.dev == 'false' && !github.event.inputs.cliTag && github.ref == 'refs/heads/main' }}
@@ -85,15 +101,7 @@ jobs:
85101
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
86102
git tag -a "${tag}" -m "${message}"
87103
git push origin "${tag}"
88-
echo "::set-output name=TAG_NAME::${{ inputs.tag }}"
89-
90-
- name: Cache local Maven repository
91-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
92-
with:
93-
path: ~/.m2/repository
94-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
95-
restore-keys: |
96-
${{ runner.os }}-maven-
104+
echo "TAG_NAME=${{ inputs.tag }}" >> $GITHUB_OUTPUT
97105
98106
- name: Set up Maven Central Repository
99107
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4.3.0
@@ -118,6 +126,7 @@ jobs:
118126
echo "AID_PROP=${prop}" >> $GITHUB_ENV
119127
120128
- name: Publish package
129+
if: inputs.publish == true
121130
run: mvn --batch-mode deploy -DskipTests ${{ env.AID_PROP }}
122131
env:
123132
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
@@ -131,26 +140,26 @@ jobs:
131140
tag_name: ${{ inputs.tag }}
132141
prerelease: ${{ inputs.dev }}
133142

134-
notify:
135-
if: inputs.dev == false
136-
needs: release
137-
uses: Checkmarx/plugins-release-workflow/.github/workflows/release-notify.yml@main
138-
with:
139-
product_name: Java Wrapper
140-
release_version: ${{ needs.release.outputs.TAG_NAME }}
141-
cli_release_version: ${{ needs.release.outputs.CLI_VERSION }}
142-
release_author: "Sypher Team"
143-
release_url: https://github.com/Checkmarx/ast-cli-java-wrapper/releases/tag/${{ needs.release.outputs.TAG_NAME }}
144-
jira_product_name: JAVA_WRAPPER
145-
secrets: inherit
143+
# notify:
144+
# if: inputs.dev == false
145+
# needs: release
146+
# uses: Checkmarx/plugins-release-workflow/.github/workflows/release-notify.yml@main
147+
# with:
148+
# product_name: Java Wrapper
149+
# release_version: ${{ needs.release.outputs.TAG_NAME }}
150+
# cli_release_version: ${{ needs.release.outputs.CLI_VERSION }}
151+
# release_author: "Sypher Team"
152+
# release_url: https://github.com/Checkmarx/ast-cli-java-wrapper/releases/tag/${{ needs.release.outputs.TAG_NAME }}
153+
# jira_product_name: JAVA_WRAPPER
154+
# secrets: inherit
146155

147-
dispatch_auto_release:
148-
name: Update Jenkins/Jetbrains/Eclipse Extensions With new Wrapper Version
149-
if: inputs.dev == false
150-
needs: notify
151-
uses: Checkmarx/plugins-release-workflow/.github/workflows/dispatch-workflow.yml@main
152-
with:
153-
cli_version: ${{ needs.release.outputs.CLI_VERSION }}
154-
is_cli_release: false
155-
is_java_release: true
156-
secrets: inherit
156+
# dispatch_auto_release:
157+
# name: Update Jenkins/Jetbrains/Eclipse Extensions With new Wrapper Version
158+
# if: inputs.dev == false
159+
# needs: notify
160+
# uses: Checkmarx/plugins-release-workflow/.github/workflows/dispatch-workflow.yml@main
161+
# with:
162+
# cli_version: ${{ needs.release.outputs.CLI_VERSION }}
163+
# is_cli_release: false
164+
# is_java_release: true
165+
# secrets: inherit

.github/workflows/update-cli.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Update checkmarx ast cli
22

33
on:
44
workflow_dispatch:
5-
repository_dispatch:
6-
types: [cli-version-update]
75

86
permissions:
97
contents: read
@@ -31,8 +29,8 @@ jobs:
3129
- name: Get Latest Checkmarx API version
3230
id: checkmarx-ast-cli
3331
run: |
34-
echo ::set-output name=release_tag::$(curl -sL https://api.github.com/repos/checkmarx/ast-cli/releases/latest | jq -r ".tag_name")
35-
echo ::set-output name=current_tag::$(<checkmarx-ast-cli.version)
32+
echo "release_tag=$(curl -sL https://api.github.com/repos/checkmarx/ast-cli/releases/latest | jq -r '.tag_name')" >> $GITHUB_OUTPUT
33+
echo "current_tag=$(<checkmarx-ast-cli.version)" >> $GITHUB_OUTPUT
3634
3735
- name: Update Checkmarx cli version
3836
if: steps.checkmarx-ast-cli.outputs.current_tag != steps.checkmarx-ast-cli.outputs.release_tag

checkmarx-ast-cli.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.48
1+
2.3.54

src/main/resources/cx-linux

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:f73e555c94ea77a10d31e37de49e40d3468ec2787e4e6d917539409210a8fe8d
3-
size 81281208
2+
oid sha256:776d9864c0104e1d0023641ef931bd1c58478cf56768ce77f2bfbfd6e9e64493
3+
size 80568482

src/main/resources/cx-linux-arm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:101acdd3d54073d9964986e279da786e527d0e649f5ae5473a79481bbb8389ef
3-
size 76415160
2+
oid sha256:d40b3cfb9f930e96a9d6b494d4c7b9cd98e3bb857e55a0f55c92d764bb8c3c1a
3+
size 75235490

src/main/resources/cx-mac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:71a744df366cddf2312b2e4a51f1174ab785d06b48506e08c3c8ee9cde8f82cf
3-
size 162260464
2+
oid sha256:df4a2d6b72936afa65df8730f0ee491f6d518286421063f50df2e48d3d5b56f9
3+
size 160422432

src/main/resources/cx.exe

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:489659950e778b01bf66ba126cd52a1acf8f124db62407b190516c12648baf6b
3-
size 83262400
2+
oid sha256:c7227ac9dd89f344c12629d367774a2428595b3daff0a2e710981d924f13dbf4
3+
size 82488128

0 commit comments

Comments
 (0)