diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8a471655c..c6f1d4b1a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,9 +7,11 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: macos-latest env: - GOPRIVATE: "github.com/checkmarxDev/*" + AC_PASSWORD: ${{ secrets.AC_PASSWORD }} + APPLE_DEVELOPER_CERTIFICATE_P12_BASE64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }} + APPLE_DEVELOPER_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }} steps: - name: Checkout uses: actions/checkout@v2.3.4 @@ -17,8 +19,19 @@ jobs: uses: actions/setup-go@v2 with: go-version: '^1.17.1' - - name: Setup git - run: git config --global url."https://${{ secrets.PERSONAL_ACCESS_TOKEN }}:@github.com/".insteadOf "https://github.com" + - name: Import Code-Signing Certificates + uses: Apple-Actions/import-codesign-certs@v1 + with: + # The certificates in a PKCS12 file encoded as a base64 string + p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }} + # The password used to import the PKCS12 file. + p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }} + - name: Install gon + run: | + brew tap mitchellh/gon + brew install mitchellh/gon/gon + - name: Install docker + uses: docker-practice/actions-setup-docker@1.0.9 - name: Login to Docker Hub uses: docker/login-action@v1 with: diff --git a/.goreleaser.yml b/.goreleaser.yml index 1d6bc71d5..ae8827e0a 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -10,13 +10,12 @@ builds: env: - CGO_ENABLED=0 binary: cx + id: cx goos: - linux - windows - - darwin goarch: - amd64 - - arm64 ignore: - goos: darwin goarch: 386 @@ -29,6 +28,38 @@ builds: - -w - -X github.com/checkmarx/ast-cli/internal/params.Version={{.Version}} + - main: ./cmd/main.go + env: + - CGO_ENABLED=0 + binary: cx + id: cx-mac-arm + goos: + - darwin + goarch: + - arm64 + hooks: + post: gon gonArm.hcl + ldflags: + - -s + - -w + - -X github.com/checkmarx/ast-cli/internal/params.Version={{.Version}} + + - main: ./cmd/main.go + env: + - CGO_ENABLED=0 + binary: cx + id: cx-mac-amd + goos: + - darwin + goarch: + - amd64 + hooks: + post: gon gonAmd.hcl + ldflags: + - -s + - -w + - -X github.com/checkmarx/ast-cli/internal/params.Version={{.Version}} + dockers: - use: docker dockerfile: Dockerfile @@ -37,15 +68,28 @@ dockers: - "cxsdlc/ast-cli:{{ .Tag }}" - "checkmarx/ast-cli:latest" - "checkmarx/ast-cli:{{ .Tag }}" + archives: - - format_overrides: - - goos: windows - format: zip + - id: cx-windows-linux-archive + builds: + - cx replacements: amd64: x64 386: x32 + files: + - LICENSE + - id: cx-mac-arm-archive + builds: + - cx-mac-arm + files: + - LICENSE + - ./dist/cx-mac-arm_darwin_arm64/cx.dmg + - id: cx-mac-amd-archive + builds: + - cx-mac-amd files: - LICENSE + - ./dist/cx-mac-amd_darwin_amd64/cx.dmg brews: - tap: diff --git a/README.md b/README.md index 305fb5619..925370ef4 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ Project Link: [https://github.com/Checkmarx/ast-cli](https://github.com/Checkmar Find more integrations from our team [here](https://github.com/Checkmarx/ci-cd-integrations#checkmarx-ast-integrations) -© 2022 Checkmarx Ltd. All Rights Reserved. +© 2022 Checkmarx Ltd. All Rights Reserved. [docker-shield]: https://img.shields.io/docker/pulls/checkmarx/ast-cli diff --git a/gon b/gon new file mode 100755 index 000000000..cca60664f Binary files /dev/null and b/gon differ diff --git a/gonAmd.hcl b/gonAmd.hcl new file mode 100644 index 000000000..26607ae29 --- /dev/null +++ b/gonAmd.hcl @@ -0,0 +1,17 @@ +# gonArm.hcl +source = ["./dist/cx-mac-amd_darwin_amd64/cx"] +bundle_id = "com.checkmarx.cli" + +apple_id { + username = "tiago.baptista@checkmarx.com" + password = "@env:AC_PASSWORD" +} + +sign { + application_identity = "Developer ID Application: CHECKMARX LTD (Z68SAQG5BR)" +} + +dmg { + output_path = "./dist/cx-mac-amd_darwin_amd64/cx.dmg" + volume_name = "cx" +} diff --git a/gonArm.hcl b/gonArm.hcl new file mode 100644 index 000000000..3ed5ab4e3 --- /dev/null +++ b/gonArm.hcl @@ -0,0 +1,17 @@ +# gonArm.hcl +source = ["./dist/cx-mac-arm_darwin_arm64/cx"] +bundle_id = "com.checkmarx.cli" + +apple_id { + username = "tiago.baptista@checkmarx.com" + password = "@env:AC_PASSWORD" +} + +sign { + application_identity = "Developer ID Application: CHECKMARX LTD (Z68SAQG5BR)" +} + +dmg { + output_path = "./dist/cx-mac-arm_darwin_arm64/cx.dmg" + volume_name = "cx" +}