diff --git a/.circleci/config.yml b/.circleci/config.yml index db47a3e..c84c105 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -100,7 +100,7 @@ jobs: iac-scan: disabled lint_commit_message: docker: - - image: cimg/node:14.19 + - image: cimg/node:18.19.1 steps: - checkout - attach_workspace: @@ -150,7 +150,7 @@ jobs: command: echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin - node/install: install-yarn: false - node-version: '12' + node-version: '18' - run: name: Release binaries to GitHub command: ./scripts/release-github.sh diff --git a/.github/actions/setup_shellspec/action.yml b/.github/actions/setup_shellspec/action.yml index 9d5700c..5f07dc7 100644 --- a/.github/actions/setup_shellspec/action.yml +++ b/.github/actions/setup_shellspec/action.yml @@ -5,7 +5,7 @@ runs: steps: - uses: actions/setup-node@v1 with: - node-version: 15 + node-version: 18 - name: Install Snyk with npm shell: bash @@ -17,7 +17,7 @@ runs: - uses: actions/setup-go@v2 with: - go-version: '1.19' + go-version: '1.22' - name: Build custom rules SDK shell: bash diff --git a/.github/workflows/contract.yml b/.github/workflows/contract.yml index 8782172..580a49a 100644 --- a/.github/workflows/contract.yml +++ b/.github/workflows/contract.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/setup-node@v1 with: - node-version: 15 + node-version: 18 - name: Install Snyk with npm run: | @@ -30,7 +30,7 @@ jobs: - uses: actions/setup-go@v2 with: - go-version: '1.19' + go-version: '1.22' - name: Build Golang CLI run: go build -o snyk-iac-rules . diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0073e0b..a122426 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/setup-go@v2 with: - go-version: '1.19' + go-version: '1.22' - name: Build Golang CLI run: go build -o snyk-iac-rules . @@ -95,7 +95,7 @@ jobs: - uses: actions/setup-go@v2 with: - go-version: '1.19' + go-version: '1.22' - name: Install NPM package - non-Windows if: ${{ matrix.os != 'windows' }} @@ -141,7 +141,7 @@ jobs: - name: Build binaries uses: goreleaser/goreleaser-action@v2 with: - args: --snapshot --rm-dist + args: --snapshot --clean - name: Test Dockerfile run: | diff --git a/.goreleaser.yml b/.goreleaser.yml index ab49b40..0eae3e5 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,3 +1,7 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=jcroql +version: 2 + project_name: snyk-iac-rules before: @@ -27,13 +31,16 @@ archives: - id: default files: - none* - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" - replacements: - darwin: Darwin - linux: Linux - windows: Windows - 386: i386 - amd64: x86_64 + name_template: >- + {{- .ProjectName }}_ + {{- .Version }}_ + {{- if eq .Os "darwin" }}Darwin + {{- else if eq .Os "linux" }}Linux + {{- else if eq .Os "windows" }}Windows + {{- else }}{{ .Os }}{{ end }} + {{- if eq .Arch "386" }}i386 + {{- else if eq .Arch "amd64" }}x86_64 + {{- else }}{{ .Arch }}{{ end -}} format: tar.gz format_overrides: - goos: windows @@ -83,12 +90,12 @@ brews: # Default is false. skip_upload: false # GitHub repository to push the formula to - tap: + repository: owner: snyk name: homebrew-tap token: "{{ .Env.SNYK_ACCESS_TOKEN }}" - folder: Formula + directory: Formula commit_author: name: snyk email: cloud-dev-ex@users.noreply.github.com @@ -96,11 +103,11 @@ brews: license: Apache-2.0 description: "Write, debug, test, and bundle custom rules for Snyk Infrastructure as Code." -scoop: - # If set to auto, the release will not be uploaded to the scoop bucket - # in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1 - # Default is false. - skip_upload: false +# scoops: +# # If set to auto, the release will not be uploaded to the scoop bucket +# # in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1 +# # Default is false. +# - skip_upload: false # Repository to push the app manifest to. bucket: diff --git a/packaging/npm/passthrough.js b/packaging/npm/passthrough.js index b989654..de6dab3 100644 --- a/packaging/npm/passthrough.js +++ b/packaging/npm/passthrough.js @@ -18,6 +18,7 @@ switch (process.platform) { var arch = '' switch (process.arch) { case 'arm' : + case 'arm64': arch = 'arm64'; break; case 'x64': diff --git a/scripts/release-github.sh b/scripts/release-github.sh index 86722a4..48f84c6 100755 --- a/scripts/release-github.sh +++ b/scripts/release-github.sh @@ -3,14 +3,14 @@ set -eo pipefail if ! which goreleaser >/dev/null ; then - go install github.com/goreleaser/goreleaser@v1.9.2 + go install github.com/goreleaser/goreleaser/v2@latest fi # Check configuration goreleaser check FLAGS="" -FLAGS+="--rm-dist " +FLAGS+="--clean " # Only CI system should publish artifacts if [ "$CI" != true ]; then diff --git a/scripts/release-npm.sh b/scripts/release-npm.sh index 6f2a4af..c85d761 100755 --- a/scripts/release-npm.sh +++ b/scripts/release-npm.sh @@ -20,7 +20,7 @@ for i in "$@"; do done if ! which goreleaser >/dev/null ; then - go install github.com/goreleaser/goreleaser@v1.9.2 + go install github.com/goreleaser/goreleaser/v2@latest fi # Check configuration