Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add golang binary for windows to releases #3847

Merged
merged 3 commits into from
Sep 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
96 changes: 46 additions & 50 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,12 @@ jobs:
- attach_workspace:
at: .
- setup_npm
- run:
name: Copy Windows cliv2 binaries to binary-releases staging area
command: |
ls -la cliv2/bin
cp cliv2/bin/snyk-win.exe binary-releases/snyk-win.exe
cp cliv2/bin/snyk-win.exe.sha256 binary-releases/snyk-win.exe.sha256
- run:
name: Signing shasums
command: make binary-releases/sha256sums.txt.asc
Expand Down Expand Up @@ -667,6 +673,34 @@ jobs:
paths:
- ./cliv2/bin

v2-rename-windows-artifact:
executor: linux
working_directory: /home/circleci/snyk
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Rename snyk_windows_amd64.exe artifact
command: mv snyk_windows_amd64.exe snyk-win.exe
working_directory: ./cliv2/bin
- run:
name: Regenerate sha256
command: |
shasum -a 256 snyk-win.exe > snyk-win.exe.sha256
shasum -a 256 -c snyk-win.exe.sha256
working_directory: ./cliv2/bin
- run:
name: Show files
command: |
ls -la
cat snyk-win.exe.sha256
working_directory: ./cliv2/bin
- persist_to_workspace:
root: .
paths:
- ./cliv2/bin

v2-prepare-release:
executor: linux
working_directory: /home/circleci/snyk
Expand Down Expand Up @@ -755,7 +789,7 @@ jobs:
name: Run integration tests
working_directory: ./cliv2
environment:
TEST_SNYK_EXECUTABLE_PATH: ./bin/snyk_windows_amd64.exe
TEST_SNYK_EXECUTABLE_PATH: ./bin/snyk-win.exe
command: |
$env:SNYK_TOKEN = $env:SNYK_API_KEY
./bin/snyk_tests_windows_amd64.exe
Expand All @@ -772,7 +806,7 @@ jobs:
name: Run integration tests
working_directory: ./cliv2
environment:
TEST_SNYK_EXECUTABLE_PATH: ./bin/snyk_windows_amd64.exe
TEST_SNYK_EXECUTABLE_PATH: ./bin/snyk-win.exe
HTTPS_PROXY: http://localhost:8080
command: |
$env:SNYK_TOKEN = $env:SNYK_API_KEY
Expand Down Expand Up @@ -859,13 +893,6 @@ workflows:
name: Version
requires:
- Build
filters:
branches:
only:
- /^chore\/.+$/
- /^.*test.*$/
- /^.*cliv2.*$/
- master
- build-artifact:
name: Build (<< matrix.artifact >>)
requires:
Expand Down Expand Up @@ -926,10 +953,10 @@ workflows:
- Build (snyk-linux)
- Build (snyk-linux-arm64)
- Build (snyk-macos)
- Build (snyk-win.exe)
- Build (snyk-for-docker-desktop-darwin-x64.tar.gz)
- Build (snyk-for-docker-desktop-darwin-arm64.tar.gz)
- Build (docker-mac-signed-bundle.tar.gz)
- v2 / Prepare Release
- should-release:
name: Release?
type: approval
Expand Down Expand Up @@ -963,74 +990,43 @@ workflows:
#
- v2-lint:
name: v2 / Lint
filters:
branches:
only:
- /^.*cliv2.*$/
- master
- v2-unit-test:
name: v2 / Unit Tests
filters:
branches:
only:
- /^.*cliv2.*$/
- master
- v2-build-artifact:
name: v2 / Build (linux/amd64)
requires:
- Build (snyk-linux)
go_os: linux
go_arch: amd64
filters:
branches:
only:
- /^.*cliv2.*$/
- master
- v2-build-artifact:
name: v2 / Build (linux/arm64)
requires:
- Build (snyk-linux-arm64)
go_os: linux
go_arch: arm64
filters:
branches:
only:
- /^.*cliv2.*$/
- master
- v2-build-artifact:
name: v2 / Build (darwin/amd64)
requires:
- Build (snyk-macos)
go_os: darwin
go_arch: amd64
filters:
branches:
only:
- /^.*cliv2.*$/
- master
- v2-build-artifact:
name: v2 / Build (windows/amd64)
requires:
- Build (snyk-win.exe)
go_os: windows
go_arch: amd64
filters:
branches:
only:
- /^.*cliv2.*$/
- master
- v2-rename-windows-artifact:
name: v2 / Rename windows/amd64 artifact
requires:
- v2 / Sign (windows/amd64)
- v2-build-artifact:
name: v2 / Build (alpine/amd64)
requires:
- Build (snyk-alpine)
go_os: alpine
go_arch: amd64
c_compiler: /usr/bin/musl-gcc
filters:
branches:
only:
- /^.*cliv2.*$/
- master
- v2-test-linux-amd64:
name: v2 / Integration Tests (linux/amd64)
requires:
Expand All @@ -1050,11 +1046,11 @@ workflows:
- v2-test-windows-amd64:
name: v2 / Integration Tests (windows/amd64)
requires:
- v2 / Build (windows/amd64)
- v2 / Rename windows/amd64 artifact
- v2-test-proxy-windows-amd64:
name: v2 / Proxy Integration Tests (windows/amd64)
requires:
- v2 / Build (windows/amd64)
- v2 / Rename windows/amd64 artifact
# Tests for backwards compatibility with CLIv1
- test-alpine:
name: v2 / Jest Acceptance Tests (alpine/amd64)
Expand All @@ -1078,8 +1074,8 @@ workflows:
name: v2 / Jest Acceptance Tests (windows/amd64)
context: nodejs-install
requires:
- v2 / Build (windows/amd64)
test_snyk_command: C:\Users\circleci\snyk\cliv2\bin\snyk_windows_amd64.exe
- v2 / Rename windows/amd64 artifact
test_snyk_command: C:\Users\circleci\snyk\cliv2\bin\snyk-win.exe
- test-macos:
name: v2 / Jest Acceptance Tests (darwin/amd64)
context: nodejs-install
Expand Down Expand Up @@ -1109,4 +1105,4 @@ workflows:
- v2 / Build (linux/amd64)
- v2 / Build (linux/arm64)
- v2 / Sign (darwin/amd64)
- v2 / Sign (windows/amd64)
- v2 / Rename windows/amd64 artifact