From eba295b2bc0cc0ebbbf0725d143c53a7d59d542d Mon Sep 17 00:00:00 2001 From: Owen Rumney Date: Thu, 9 Dec 2021 08:47:42 +0000 Subject: [PATCH 1/2] Update build assets --- .github/plugin_template.yaml | 24 ++++++++++++++++++++++-- .goreleaser.yml | 16 +++++++++++----- plugin.yaml | 22 +++++++++++++++++++++- 3 files changed, 54 insertions(+), 8 deletions(-) diff --git a/.github/plugin_template.yaml b/.github/plugin_template.yaml index d496728a..539c98fe 100644 --- a/.github/plugin_template.yaml +++ b/.github/plugin_template.yaml @@ -9,5 +9,25 @@ platforms: - selector: # optional os: linux arch: amd64 - uri: https://github.com/aquasecurity/trivy-plugin-aqua/releases/download/PLACEHOLDERVERSION/PLACEHOLDERVERSION.tar.gz - bin: ./aqua \ No newline at end of file + uri: https://github.com/aquasecurity/trivy-plugin-aqua/releases/download/PLACEHOLDERVERSION/linux_amd64_PLACEHOLDERVERSION.tar.gz + bin: ./aqua + - selector: + os: linux + arch: arm64 + uri: https://github.com/aquasecurity/trivy-plugin-aqua/releases/download/PLACEHOLDERVERSION/linux_arm64_PLACEHOLDERVERSION.tar.gz + bin: ./aqua + - selector: + os: darwin + arch: arm64 + uri: https://github.com/aquasecurity/trivy-plugin-aqua/releases/download/PLACEHOLDERVERSION/darwin_amd64_PLACEHOLDERVERSION.tar.gz + bin: ./aqua + - selector: + os: darwin + arch: arm64 + uri: https://github.com/aquasecurity/trivy-plugin-aqua/releases/download/PLACEHOLDERVERSION/darwin_arm64_PLACEHOLDERVERSION.tar.gz + bin: ./aqua + - selector: + os: windows + arch: amd64 + uri: https://github.com/aquasecurity/trivy-plugin-aqua/releases/download/PLACEHOLDERVERSION/windows_amd64_PLACEHOLDERVERSION.zip + bin: aqua.exe \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml index cc4ffc4d..d0e48aea 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -5,10 +5,13 @@ before: builds: - main: ./cmd/aqua binary: aqua - goos: - - linux - goarch: - - amd64 + + targets: + - linux_amd64 + - linux_arm64 + - darwin_amd64 + - darwin_arm64 + - windows_arm64 changelog: sort: asc @@ -18,7 +21,10 @@ changelog: - '^test:' archives: - - name_template: "v{{ .Version }}" + - name_template: "{{ .Os }}_{{ .Arch }}_v{{ .Version }}" + format_overrides: + - goos: windows + format: zip release: prerelease: auto diff --git a/plugin.yaml b/plugin.yaml index 4eda16a5..cf8171ea 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -10,4 +10,24 @@ platforms: os: linux arch: amd64 uri: https://github.com/aquasecurity/trivy-plugin-aqua/releases/download/v0.3.0/v0.3.0.tar.gz - bin: ./aqua \ No newline at end of file + bin: ./aqua + - selector: + os: linux + arch: arm64 + uri: https://github.com/aquasecurity/trivy-plugin-aqua/releases/download/v0.3.0/v0.3.0.tar.gz + bin: ./aqua + - selector: + os: darwin + arch: arm64 + uri: https://github.com/aquasecurity/trivy-plugin-aqua/releases/download/v0.3.0/v0.3.0.tar.gz + bin: ./aqua + - selector: + os: darwin + arch: amd64 + uri: https://github.com/aquasecurity/trivy-plugin-aqua/releases/download/v0.3.0/v0.3.0.tar.gz + bin: ./aqua + - selector: + os: windows + arch: amd64 + uri: https://github.com/aquasecurity/trivy-plugin-aqua/releases/download/v0.3.0/v0.3.0.zip + bin: aqua.exe \ No newline at end of file From 0b6a373a582acc26b30620bf809e8b6784c78563 Mon Sep 17 00:00:00 2001 From: Owen Rumney Date: Thu, 9 Dec 2021 09:05:28 +0000 Subject: [PATCH 2/2] Restructure the github action to download the source first --- .github/workflows/release.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d1337a35..121f68d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,12 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - - name: Run integration tests - env: - AQUA_KEY: ${{ secrets.AQUA_KEY }} - AQUA_SECRET: ${{ secrets.AQUA_SECRET }} - TRIVY_RUN_AS_PLUGIN: aqua - run: make integration-test + - uses: actions/checkout@v2 with: @@ -28,6 +23,13 @@ jobs: go-version: '1.17' - run: go version + - name: Run integration tests + env: + AQUA_KEY: ${{ secrets.AQUA_KEY }} + AQUA_SECRET: ${{ secrets.AQUA_SECRET }} + TRIVY_RUN_AS_PLUGIN: aqua + run: make integration-test + - name: Release uses: goreleaser/goreleaser-action@v2 with: