Skip to content

Commit

Permalink
alpha:bugfix - fixing errors with alpha workflow publish release
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Martins <nathan.martins@zup.com.br>
  • Loading branch information
nathanmartinszup committed Dec 8, 2021
1 parent 35f5a70 commit 14675e9
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 51 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" ]
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 14675e9

Please sign in to comment.