Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/scripts/update_cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

release=$1
filename_windows=ast-cli_${release}_windows_x64.zip
filename_linux=ast-cli_${release}_linux_x64.tar.gz
filename_darwin=ast-cli_${release}_darwin_x64.tar.gz

#Windows
echo "Updating windows binary"
wget https://github.com/Checkmarx/ast-cli/releases/download/${release}/${filename_windows}
unzip ${filename_windows} -d tmp
mv ./tmp/cx.exe ./src/main/resources/cx.exe
rm -r tmp
rm ${filename_windows}

#linux
echo "Updating linux binary"
wget https://github.com/Checkmarx/ast-cli/releases/download/${release}/${filename_linux}
mkdir ./tmp/
tar -xvzf ${filename_linux} -C ./tmp/
mv ./tmp/cx ./src/main/resources/cx-linux
rm -r tmp
rm ${filename_linux}

#darwin
echo "Updating mac binary"
wget https://github.com/Checkmarx/ast-cli/releases/download/${release}/${filename_darwin}
mkdir ./tmp/
tar -xvzf ${filename_darwin} -C ./tmp/
mv ./tmp/cx ./src/main/resources/cx-mac
rm -r tmp
rm ${filename_darwin}
17 changes: 2 additions & 15 deletions .github/workflows/main.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Integration Tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
name: AST Javascript wrapper CI

on: [pull_request]
jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
#node-version: [10.x, 12.x, 14.x, 15.x]
node-version: [ 15.x ]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Copy executable
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/manual-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Manual Tag Creation

on:
workflow_dispatch:
inputs:
tag:
description: 'Next release tag'
required: true

jobs:
tag-creation:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Tag
run: |
echo ${{ github.event.inputs.tag }}
echo "NEXT_VERSION=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
- name: Create tag
uses: actions-ecosystem/action-push-tag@v1
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
tag: ${{ env.NEXT_VERSION }}
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]
push:
tags:
- "*"

jobs:
publish-gpr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/setup-node@v2
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
- run: npm ci
- name: Update version
run: npm version ${{ env.RELEASE_VERSION }}
- name: npm build
run: npm run build
- name: Set up NPM authentication
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/update-cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Update checkmarx ast cli
on:
workflow_dispatch:
schedule:
- cron: '*/5 * * * *'

jobs:
update-checkmarx-cli:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get Latest Checkmarx API version
id: checkmarx-ast-cli
run: |
echo ::set-output name=release_tag::$(curl -sL https://api.github.com/repos/Checkmarx/ast-cli/releases/latest | jq -r ".tag_name")
echo ::set-output name=current_tag::$(<checkmarx-ast-cli.version)
- name: Update Checkmarx cli version
if: steps.checkmarx-ast-cli.outputs.current_tag != steps.checkmarx-ast-cli.outputs.release_tag
env:
RELEASE_TAG: ${{ steps.checkmarx-ast-cli.outputs.release_tag }}
run: |
# Update current release
echo ${{ steps.checkmarx-ast-cli.outputs.release_tag }} > checkmarx-ast-cli.version
- name: Download latest cli and update branch
if: steps.checkmarx-ast-cli.outputs.current_tag != steps.checkmarx-ast-cli.outputs.release_tag
run: |
# Update binaries
chmod +x ./.github/scripts/update_cli.sh
./.github/scripts/update_cli.sh ${{ steps.checkmarx-ast-cli.outputs.release_tag }}
- name: Create Pull Request
if: steps.checkmarx-ast-cli.outputs.current_tag != steps.checkmarx-ast-cli.outputs.release_tag
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
commit-message: Update checkmarx-ast-cli to ${{ steps.checkmarx-ast-cli.outputs.release_tag }}
title: Update checkmarx-ast-cli binaries with ${{ steps.checkmarx-ast-cli.outputs.release_tag }}
body: |
Updates [checkmarx-ast-cli][1] to ${{ steps.checkmarx-ast-cli.outputs.release_tag }}

Auto-generated by [create-pull-request][2]

[1]: https://github.com/Checkmarx/checkmarx-ast-cli
labels: dependencies, automated pr
branch: feature/update_cli
1 change: 1 addition & 0 deletions checkmarx-ast-cli.version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.0.0-rc.22