From bfb07e6b03c71370a14b6eb216c1c16fe5ad46ff Mon Sep 17 00:00:00 2001 From: nathanmartinszup <63246935+nathanmartinszup@users.noreply.github.com> Date: Fri, 14 Jan 2022 07:15:19 -0300 Subject: [PATCH] workflows:chore - removing old release file to avoid confusion (#924) Signed-off-by: Nathan Martins --- .github/workflows/release.yml | 182 ---------------------------------- 1 file changed, 182 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 9e57acfa7..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,182 +0,0 @@ -# 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. - -name: Release - -on: - workflow_dispatch: - inputs: - releaseType: - description: 'Release type: M (Major); m (Minor); p (Path)' - required: true -permissions: read-all -jobs: - Release: - permissions: - contents: write - packages: write - runs-on: ubuntu-latest - env: - COSIGN_KEY_LOCATION: /tmp/cosign.key - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.17 - - - name: Docker Login - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Cosign Installer - uses: sigstore/cosign-installer@main - with: - cosign-release: 'v1.2.0' - - - name: Install cosign private key - run: 'echo "$COSIGN_KEY" > $COSIGN_KEY_LOCATION' - shell: bash - env: - COSIGN_KEY: ${{secrets.COSIGN_KEY}} - - - name: Version increment - id: updated-version - run: | - curl https://raw.githubusercontent.com/ZupIT/horusec-devkit/main/scripts/semver.sh -o /tmp/semver.sh - chmod +x /tmp/semver.sh - /tmp/semver.sh -${{ github.event.inputs.releaseType }} ${{ github.event.repository.full_name }} - - - name: Get current date - id: date - run: echo "::set-output name=date::$(date "+%a %b %d %H:%M:%S %Y")" - - - name: Build stand alone cli - run: | - CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags \ - "-X 'github.com/ZupIT/horusec/config/dist.standAlone=true' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Version=${{ steps.updated-version.outputs.version }}' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Commit=${{ github.sha }}' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Date=${{ steps.date.outputs.date }}'" \ - -o ./tmp/horusec_linux_x86_stand_alone ./cmd/app/main.go - - cosign sign-blob -key=$COSIGN_KEY_LOCATION \ - -output=./tmp/horusec_linux_x86_stand_alone.sig ./tmp/horusec_linux_x86_stand_alone - - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags \ - "-X 'github.com/ZupIT/horusec/config/dist.standAlone=true' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Version=${{ steps.updated-version.outputs.version }}' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Commit=${{ github.sha }}' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Date=${{ steps.date.outputs.date }}'" \ - -o ./tmp/horusec_linux_amd64_stand_alone ./cmd/app/main.go - - cosign sign-blob -key=$COSIGN_KEY_LOCATION \ - -output=./tmp/horusec_linux_amd64_stand_alone.sig ./tmp/horusec_linux_amd64_stand_alone - - CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags \ - "-X 'github.com/ZupIT/horusec/config/dist.standAlone=true' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Version=${{ steps.updated-version.outputs.version }}' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Commit=${{ github.sha }}' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Date=${{ steps.date.outputs.date }}'" \ - -o ./tmp/horusec_linux_arm64_stand_alone ./cmd/app/main.go - - cosign sign-blob -key=$COSIGN_KEY_LOCATION \ - -output=./tmp/horusec_linux_arm64_stand_alone.sig ./tmp/horusec_linux_arm64_stand_alone - - CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags \ - "-X 'github.com/ZupIT/horusec/config/dist.standAlone=true' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Version=${{ steps.updated-version.outputs.version }}' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Commit=${{ github.sha }}' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Date=${{ steps.date.outputs.date }}'" \ - -o ./tmp/horusec_win_x86_stand_alone.exe ./cmd/app/main.go - - cosign sign-blob -key=$COSIGN_KEY_LOCATION \ - -output=./tmp/horusec_win_x86_stand_alone.exe.sig ./tmp/horusec_win_x86_stand_alone.exe - - CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags \ - "-X 'github.com/ZupIT/horusec/config/dist.standAlone=true' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Version=${{ steps.updated-version.outputs.version }}' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Commit=${{ github.sha }}' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Date=${{ steps.date.outputs.date }}'" \ - -o ./tmp/horusec_win_amd64_stand_alone.exe ./cmd/app/main.go - - cosign sign-blob -key=$COSIGN_KEY_LOCATION \ - -output=./tmp/horusec_win_amd64_stand_alone.exe.sig ./tmp/horusec_win_amd64_stand_alone.exe - - CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -ldflags \ - "-X 'github.com/ZupIT/horusec/config/dist.standAlone=true' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Version=${{ steps.updated-version.outputs.version }}' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Commit=${{ github.sha }}' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Date=${{ steps.date.outputs.date }}'" \ - -o ./tmp/horusec_win_arm64_stand_alone.exe ./cmd/app/main.go - - cosign sign-blob -key=$COSIGN_KEY_LOCATION \ - -output=./tmp/horusec_win_arm64_stand_alone.exe.sig ./tmp/horusec_win_arm64_stand_alone.exe - - CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags \ - "-X 'github.com/ZupIT/horusec/config/dist.standAlone=true' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Version=${{ steps.updated-version.outputs.version }}' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Commit=${{ github.sha }}' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Date=${{ steps.date.outputs.date }}'" \ - -o ./tmp/horusec_mac_amd64_stand_alone ./cmd/app/main.go - - cosign sign-blob -key=$COSIGN_KEY_LOCATION \ - -output=./tmp/horusec_mac_amd64_stand_alone.sig ./tmp/horusec_mac_amd64_stand_alone - - CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags \ - "-X 'github.com/ZupIT/horusec/config/dist.standAlone=true' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Version=${{ steps.updated-version.outputs.version }}' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Commit=${{ github.sha }}' \ - -X 'github.com/ZupIT/horusec/cmd/app/version.Date=${{ steps.date.outputs.date }}'" \ - -o ./tmp/horusec_mac_arm64_stand_alone ./cmd/app/main.go - - cosign sign-blob -key=$COSIGN_KEY_LOCATION \ - -output=./tmp/horusec_mac_arm64_stand_alone.sig ./tmp/horusec_mac_arm64_stand_alone - env: - COSIGN_PASSWORD: ${{ secrets.COSIGN_PWD }} - - - name: Create tag - run: | - git tag ${{ steps.updated-version.outputs.version }} - sleep 5 - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 - with: - distribution: goreleaser - version: latest - args: release --rm-dist - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COSIGN_PWD: ${{ secrets.COSIGN_PWD }} - GORELEASER_CURRENT_TAG: ${{ steps.updated-version.outputs.version }} - CURRENT_DATE: ${{ steps.date.outputs.date }} - CLI_VERSION: ${{ steps.updated-version.outputs.version }} - - - name: Create release branch - if: github.event.inputs.releaseType != 'p' - run: | - git branch ${{ steps.updated-version.outputs.releaseBranchName }} - git push origin ${{ steps.updated-version.outputs.releaseBranchName }} - - - name: Push tag - run: | - git push origin ${{ steps.updated-version.outputs.version }}