Skip to content

Commit

Permalink
alpha:bugfix - fixing errors with alpha workflow publish release (#860)
Browse files Browse the repository at this point in the history
Replaced workflow action used to publish the release, also had to change binary names to match the actual name in release, since the new action does not support renaming during publish. The binary names changes let to another change, i had to change the goreleaser Dockerfiles to match correct binary according to architecture.

Depends on a new devkit tag with the ZupIT/horusec-devkit#140 fixes.

Signed-off-by: Nathan Martins <nathan.martins@zup.com.br>
(cherry picked from commit a176a24)
  • Loading branch information
nathanmartinszup committed Dec 14, 2021
1 parent 883a2d1 commit a206a0e
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 56 deletions.
102 changes: 54 additions & 48 deletions .github/workflows/alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ jobs:
COSIGN_KEY_LOCATION: /tmp/cosign.key
COSIGN_PWD: ${{ secrets.COSIGN_PWD }}


steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
with:
Expand All @@ -43,6 +43,7 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

Expand Down Expand Up @@ -91,6 +92,7 @@ jobs:
cosign sign -key $COSIGN_KEY_LOCATION horuszup/horusec-cli:alpha
env:
COSIGN_PASSWORD: ${{ secrets.COSIGN_PWD }}

- name: Create local tag
run: mage -v createAlphaTag

Expand All @@ -106,65 +108,69 @@ jobs:
GORELEASER_CURRENT_TAG: v0.0.0-alpha
CURRENT_DATE: ${{ steps.date.outputs.date }}
CLI_VERSION: alpha

- name: Delete outdate release
uses: dev-drprasad/delete-tag-and-release@v0.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
delete_release: true
tag_name: alpha

- name: Update alpha release
uses: meeDamian/github-release@2.0
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: alpha
name: alpha
draft: false
tag_name: alpha
prerelease: true
commitish: ${{ github.sha }}
gzip: false
allow_override: true
files: |
checksums.txt:./dist/checksums.txt
checksums.txt.sig:./dist/checksums.txt.sig
cosign.pub:./deployments/cosign.pub
horusec_linux_amd64:./dist/horusec_linux_amd64/horusec
horusec_linux_amd64.sig:./dist/horusec_linux_amd64/horusec.sig
horusec_linux_x86:./dist/horusec_linux_386/horusec
horusec_linux_x86.sig:./dist/horusec_linux_386/horusec.sig
horusec_mac_amd64:./dist/horusec_darwin_amd64/horusec
horusec_mac_amd64.sig:./dist/horusec_darwin_amd64/horusec.sig
horusec_win_amd64.exe:./dist/horusec_windows_amd64/horusec.exe
horusec_win_amd64.exe.sig:./dist/horusec_windows_amd64/horusec.exe.sig
horusec_win_x86.exe:./dist/horusec_windows_386/horusec.exe
horusec_win_x86.exe.sig:./dist/horusec_windows_386/horusec.exe.sig
horusec_linux_arm64:./dist/horusec_linux_arm64/horusec
horusec_linux_arm64.sig:./dist/horusec_linux_arm64/horusec.sig
horusec_win_arm64.exe:./dist/horusec_windows_arm64/horusec.exe
horusec_win_arm64.exe.sig:./dist/horusec_windows_arm64/horusec.exe.sig
horusec_mac_arm64:./dist/horusec_darwin_arm64/horusec
horusec_mac_arm64.sig:./dist/horusec_darwin_arm64/horusec.sig
horusec_linux_amd64_stand_alone:./dist/horusec-standalone_linux_amd64/horusec
horusec_linux_amd64_stand_alone.sig:./dist/horusec-standalone_linux_amd64/horusec.sig
horusec_linux_x86_stand_alone:./dist/horusec-standalone_linux_386/horusec
horusec_linux_x86_stand_alone.sig:./dist/horusec-standalone_linux_386/horusec.sig
horusec_mac_amd64_stand_alone:./dist/horusec-standalone_darwin_amd64/horusec
horusec_mac_amd64_stand_alone.sig:./dist/horusec-standalone_darwin_amd64/horusec.sig
horusec_win_amd64_stand_alone.exe:./dist/horusec-standalone_windows_amd64/horusec.exe
horusec_win_amd64_stand_alone.exe.sig:./dist/horusec-standalone_windows_amd64/horusec.exe.sig
horusec_win_x86.exe_stand_alone:./dist/horusec-standalone_windows_386/horusec.exe
horusec_win_x86.exe_stand_alone.sig:./dist/horusec-standalone_windows_386/horusec.exe.sig
horusec_linux_arm64_stand_alone:./dist/horusec-standalone_linux_arm64/horusec
horusec_linux_arm64_stand_alone.sig:./dist/horusec-standalone_linux_arm64/horusec.sig
horusec_win_arm64_stand_alone.exe:./dist/horusec-standalone_windows_arm64/horusec.exe
horusec_win_arm64_stand_alone.exe.sig:./dist/horusec-standalone_windows_arm64/horusec.exe.sig
horusec_mac_arm64_stand_alone:./dist/horusec-standalone_darwin_arm64/horusec
horusec_mac_arm64_stand_alone.sig:./dist/horusec-standalone_darwin_arm64/horusec.sig
draft: false
target_commitish: ${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
body: |
## Description
This tag it's updated every time there's a change in the main branch. It's a developement tag and should not be used in production.
## Docker images
- `docker pull horuszup/horusec-cli:alpha`
files: |
./dist/checksums.txt
./dist/checksums.txt.sig
./deployments/cosign.pub
./dist/horusec_linux_amd64/horusec_linux_amd64
./dist/horusec_linux_amd64/horusec_linux_amd64.sig
./dist/horusec_linux_386/horusec_linux_x86
./dist/horusec_linux_386/horusec_linux_x86.sig
./dist/horusec_darwin_amd64/horusec_mac_amd64
./dist/horusec_darwin_amd64/horusec_mac_amd64.sig
./dist/horusec_windows_amd64/horusec_win_amd64.exe
./dist/horusec_windows_amd64/horusec_win_amd64.exe.sig
./dist/horusec_windows_386/horusec_win_x86.exe
./dist/horusec_windows_386/horusec_win_x86.exe.sig
./dist/horusec_linux_arm64/horusec_linux_arm64
./dist/horusec_linux_arm64/horusec_linux_arm64.sig
./dist/horusec_windows_arm64/horusec_win_arm64.exe
./dist/horusec_windows_arm64/horusec_win_arm64.exe.sig
./dist/horusec_darwin_arm64/horusec_mac_arm64
./dist/horusec_darwin_arm64/horusec_mac_arm64.sig
./dist/horusec-standalone_linux_amd64/horusec_linux_amd64_stand_alone
./dist/horusec-standalone_linux_amd64/horusec_linux_amd64_stand_alone.sig
./dist/horusec-standalone_linux_386/horusec_linux_x86_stand_alone
./dist/horusec-standalone_linux_386/horusec_linux_x86_stand_alone.sig
./dist/horusec-standalone_darwin_amd64/horusec_mac_amd64_stand_alone
./dist/horusec-standalone_darwin_amd64/horusec_mac_amd64_stand_alone.sig
./dist/horusec-standalone_windows_amd64/horusec_win_amd64_stand_alone.exe
./dist/horusec-standalone_windows_amd64/horusec_win_amd64_stand_alone.exe.sig
./dist/horusec-standalone_windows_386/horusec_win_x86_stand_alone.exe
./dist/horusec-standalone_windows_386/horusec_win_x86_stand_alone.exe.sig
./dist/horusec-standalone_linux_arm64/horusec_linux_arm64_stand_alone
./dist/horusec-standalone_linux_arm64/horusec_linux_arm64_stand_alone.sig
./dist/horusec-standalone_windows_arm64/horusec_win_arm64_stand_alone.exe
./dist/horusec-standalone_windows_arm64/horusec_win_arm64_stand_alone.exe.sig
./dist/horusec-standalone_darwin_arm64/horusec_mac_arm64_stand_alone
./dist/horusec-standalone_darwin_arm64/horusec_mac_arm64_stand_alone.sig
- name: Push updates
run: mage -v gitPushAlpha
run: mage -v gitPushAlpha
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@

FROM docker:20.10-git

COPY /horusec /usr/local/bin/horusec
COPY /horusec_linux_amd64 /usr/local/bin/horusec

CMD [ "sh" ]
19 changes: 19 additions & 0 deletions deployments/Dockerfile-gorelease-arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2021 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM docker:20.10-git

COPY /horusec_linux_arm64 /usr/local/bin/horusec

CMD [ "sh" ]
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ require (
github.com/stretchr/objx v0.3.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
golang.org/x/sys v0.0.0-20211020174200-9d6173849985 // indirect
golang.org/x/net v0.0.0-20211123203042-d83791d6bcd9 // indirect
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
google.golang.org/genproto v0.0.0-20211013025323-ce878158c4d4 // indirect
Expand Down
8 changes: 5 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1167,8 +1167,10 @@ golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211123203042-d83791d6bcd9 h1:0qxwC5n+ttVOINCBeRHO0nq9X7uy8SDsPoi5OaCdIEI=
golang.org/x/net v0.0.0-20211123203042-d83791d6bcd9/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -1296,8 +1298,8 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211020174200-9d6173849985 h1:LOlKVhfDyahgmqa97awczplwkjzNaELFg3zRIJ13RYo=
golang.org/x/sys v0.0.0-20211020174200-9d6173849985/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881 h1:TyHqChC80pFkXWraUUf6RuB5IqFdQieMLwwCJokV2pc=
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
6 changes: 4 additions & 2 deletions goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ builds:
- amd64
- arm64
- 386
binary: horusec_{{ replace (replace .Os "windows" "win") "darwin" "mac" }}_{{ replace .Arch "386" "x86" }}
- id: horusec-standalone
env: [ CGO_ENABLED=0 ]
main: ./cmd/app/main.go
Expand All @@ -48,6 +49,7 @@ builds:
- amd64
- arm64
- 386
binary: horusec_{{ replace (replace .Os "windows" "win") "darwin" "mac" }}_{{ replace .Arch "386" "x86" }}_stand_alone
changelog:
skip: true
snapshot:
Expand Down Expand Up @@ -121,7 +123,7 @@ dockers:
skip_push: false
goos: linux
goarch: amd64
dockerfile: ./deployments/Dockerfile-gorelease
dockerfile: ./deployments/Dockerfile-gorelease-amd64
use: docker
build_flag_templates:
- "--pull"
Expand All @@ -137,7 +139,7 @@ dockers:
skip_push: false
goos: linux
goarch: arm64
dockerfile: ./deployments/Dockerfile-gorelease
dockerfile: ./deployments/Dockerfile-gorelease-arm64
use: docker
build_flag_templates:
- "--pull"
Expand Down

0 comments on commit a206a0e

Please sign in to comment.