Skip to content

Commit 35a2309

Browse files
update release process (#35)
1 parent c549f92 commit 35a2309

File tree

5 files changed

+73
-46
lines changed

5 files changed

+73
-46
lines changed

.github/scripts/update_cli.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ filename_darwin=ast-cli_${release}_darwin_x64.tar.gz
77

88
#Windows
99
echo "Updating windows binary"
10-
wget https://github.com/CheckmarxDev/ast-cli/releases/download/${release}/${filename_windows}
10+
wget https://github.com/checkmarx/ast-cli/releases/download/${release}/${filename_windows}
1111
unzip ${filename_windows} -d tmp
1212
mv ./tmp/cx.exe ./src/main/resources/cx.exe
1313
rm -r tmp
1414
rm ${filename_windows}
1515

1616
#linux
1717
echo "Updating linux binary"
18-
wget https://github.com/CheckmarxDev/ast-cli/releases/download/${release}/${filename_linux}
18+
wget https://github.com/checkmarx/ast-cli/releases/download/${release}/${filename_linux}
1919
mkdir ./tmp/
2020
tar -xvzf ${filename_linux} -C ./tmp/
2121
mv ./tmp/cx ./src/main/resources/cx-linux
@@ -24,7 +24,7 @@ rm ${filename_linux}
2424

2525
#darwin
2626
echo "Updating mac binary"
27-
wget https://github.com/CheckmarxDev/ast-cli/releases/download/${release}/${filename_darwin}
27+
wget https://github.com/checkmarx/ast-cli/releases/download/${release}/${filename_darwin}
2828
mkdir ./tmp/
2929
tar -xvzf ${filename_darwin} -C ./tmp/
3030
mv ./tmp/cx ./src/main/resources/cx-mac

.github/workflows/ci.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,20 @@ jobs:
66
integration-tests:
77
runs-on: ubuntu-latest
88
steps:
9-
- name: Checkout the repository
9+
- name: Checkout
1010
uses: actions/checkout@v2
11+
1112
- name: Set up JDK 8
1213
uses: actions/setup-java@v1
1314
with:
1415
java-version: 8
15-
- name: Copy executable
16-
run: cp ./src/main/resources/cx-linux /tmp/
17-
- name: Permissions to executable
18-
run: sudo chmod 777 /tmp/cx-linux
16+
1917
- name: Run tests with Maven
2018
env:
2119
CX_CLIENT_ID: ${{ secrets.CLIENT_ID}}
2220
CX_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET}}
2321
CX_BASE_URI: ${{ secrets.BASE_URI }}
2422
CX_TENANT: ${{ secrets.TENANT }}
25-
PATH_TO_EXECUTABLE: /tmp/cx-linux
2623
run: mvn -B test --file pom.xml
2724
cx-scan:
2825
runs-on: ubuntu-latest

.github/workflows/manual-tag.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v2.3.4
15+
uses: actions/checkout@v2
1616
with:
1717
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
1818
- name: Tag

.github/workflows/release.yml

Lines changed: 57 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,60 @@ jobs:
99
release:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
13-
14-
- name: Set env
15-
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
16-
17-
- name: Cache local Maven repository
18-
uses: actions/cache@v2
19-
with:
20-
path: ~/.m2/repository
21-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
22-
restore-keys: |
23-
${{ runner.os }}-maven-
24-
25-
- name: Set up Maven Central Repository
26-
uses: actions/setup-java@v2
27-
with:
28-
java-version: '11'
29-
distribution: 'adopt'
30-
server-id: ossrh
31-
server-username: MAVEN_USERNAME
32-
server-password: MAVEN_PASSWORD
33-
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
34-
gpg-passphrase: MAVEN_GPG_PASSPHRASE
35-
36-
- name: Update the POM version.
37-
run: mvn -B versions:set -DnewVersion='${{ env.RELEASE_VERSION }}' --file pom.xml -DskipTests
38-
39-
- name: Publish package
40-
run: mvn --batch-mode deploy -DskipTests
41-
env:
42-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
43-
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
44-
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
16+
17+
- name: Set env
18+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
19+
20+
- name: Cache local Maven repository
21+
uses: actions/cache@v2
22+
with:
23+
path: ~/.m2/repository
24+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
25+
restore-keys: |
26+
${{ runner.os }}-maven-
27+
28+
- name: Set up Maven Central Repository
29+
uses: actions/setup-java@v2
30+
with:
31+
java-version: '11'
32+
distribution: 'adopt'
33+
server-id: ossrh
34+
server-username: MAVEN_USERNAME
35+
server-password: MAVEN_PASSWORD
36+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
37+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
38+
39+
- name: Update the POM version.
40+
run: mvn -B versions:set -DnewVersion='${{ env.RELEASE_VERSION }}' --file pom.xml -DskipTests
41+
42+
- name: Commit pom change version
43+
run: |
44+
git config user.name github-actions
45+
git config user.email [email protected]
46+
git add pom.xml
47+
git commit -m '[auto-release] Update pom version'
48+
git push
49+
50+
- name: Publish package
51+
run: mvn --batch-mode deploy -DskipTests
52+
env:
53+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
54+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
55+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
56+
57+
- name: Build Changelog
58+
id: build_changelog
59+
uses: mikepenz/[email protected]
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
with:
63+
outputFile: ${{ github.workspace }}-CHANGELOG.txt
64+
65+
- name: Release
66+
uses: softprops/action-gh-release@v1
67+
with:
68+
body_path: ${{ github.workspace }}-CHANGELOG.txt

.github/workflows/update-cli.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Update checkmarx ast cli
2+
23
on:
34
workflow_dispatch:
45
schedule:
@@ -8,25 +9,30 @@ jobs:
89
updateCheckmarxJenkins:
910
runs-on: ubuntu-latest
1011
steps:
11-
- uses: actions/checkout@v2
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
1215
- name: Get Latest Checkmarx API version
1316
id: checkmarx-ast-cli
1417
run: |
15-
echo ::set-output name=release_tag::$(curl -sL https://api.github.com/repos/CheckmarxDev/ast-cli/releases/latest | jq -r ".tag_name")
18+
echo ::set-output name=release_tag::$(curl -sL https://api.github.com/repos/checkmarx/ast-cli/releases/latest | jq -r ".tag_name")
1619
echo ::set-output name=current_tag::$(<checkmarx-ast-cli.version)
20+
1721
- name: Update Checkmarx cli version
1822
if: steps.checkmarx-ast-cli.outputs.current_tag != steps.checkmarx-ast-cli.outputs.release_tag
1923
env:
2024
RELEASE_TAG: ${{ steps.checkmarx-ast-cli.outputs.release_tag }}
2125
run: |
2226
# Update current release
2327
echo ${{ steps.checkmarx-ast-cli.outputs.release_tag }} > checkmarx-ast-cli.version
28+
2429
- name: Download latest cli and update branch
2530
if: steps.checkmarx-ast-cli.outputs.current_tag != steps.checkmarx-ast-cli.outputs.release_tag
2631
run: |
2732
# Update binaries
2833
chmod +x ./.github/scripts/update_cli.sh
2934
./.github/scripts/update_cli.sh ${{ steps.checkmarx-ast-cli.outputs.release_tag }}
35+
3036
- name: Create Pull Request
3137
if: steps.checkmarx-ast-cli.outputs.current_tag != steps.checkmarx-ast-cli.outputs.release_tag
3238
uses: peter-evans/create-pull-request@v3
@@ -39,6 +45,6 @@ jobs:
3945
4046
Auto-generated by [create-pull-request][2]
4147
42-
[1]: https://github.com/CheckmarxDev/checkmarx-ast-cli
48+
[1]: https://github.com/Checkmarx/checkmarx-ast-cli
4349
labels: dependencies, automated pr
4450
branch: feature/update_cli

0 commit comments

Comments
 (0)