From 5de57c0fada7a44f59d62b4d2d9ef32938b1bfcb Mon Sep 17 00:00:00 2001 From: Wilian Gabriel Date: Fri, 18 Feb 2022 19:16:34 -0300 Subject: [PATCH] workflow:feat - Automating the release body In this PR I'll update Release Beta, RC and Final to set automatic body in release notes. I changed file release-new.yml to release-final.yml and I changed file alpha.yml to release-alpha.yml Signed-off-by: Wilian Gabriel --- .github/CODEOWNERS | 3 +- .../{alpha.yml => release-alpha.yml} | 7 ++-- .github/workflows/release-beta.yml | 6 ++- .../{release-new.yml => release-final.yml} | 12 ++++-- .github/workflows/release-rc.yml | 9 +++-- goreleaser.yml | 38 ++++++++++++++++--- 6 files changed, 53 insertions(+), 22 deletions(-) rename .github/workflows/{alpha.yml => release-alpha.yml} (99%) rename .github/workflows/{release-new.yml => release-final.yml} (90%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7dc4d579f..435c87e5b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,3 @@ # GitHub code owners # See https://github.com/blog/2392-introducing-code-owners -* @wiliansilvazup @matheusalcantarazup @lucasbrunozup @nathanmartinszup @iancardosozup - +* @wiliansilvazup @matheusalcantarazup @lucasbrunozup @nathanmartinszup @iancardosozup @oliveirafelipezup diff --git a/.github/workflows/alpha.yml b/.github/workflows/release-alpha.yml similarity index 99% rename from .github/workflows/alpha.yml rename to .github/workflows/release-alpha.yml index f90e8dd1c..7a53cc5f0 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/release-alpha.yml @@ -11,22 +11,22 @@ # 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: alpha +name: release-alpha on: push: branches: - main permissions: read-all jobs: - Alpha: + ReleaseAlpha: permissions: contents: write packages: write + issues: write runs-on: ubuntu-latest env: COSIGN_KEY_LOCATION: /tmp/cosign.key COSIGN_PWD: ${{ secrets.COSIGN_PWD }} - steps: - name: Checkout uses: actions/checkout@v2 @@ -154,7 +154,6 @@ jobs: ./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 diff --git a/.github/workflows/release-beta.yml b/.github/workflows/release-beta.yml index b42607aef..b8696547b 100644 --- a/.github/workflows/release-beta.yml +++ b/.github/workflows/release-beta.yml @@ -20,15 +20,16 @@ on: required: true permissions: read-all jobs: - Beta: + ReleaseBeta: permissions: contents: write packages: write + issues: write runs-on: ubuntu-latest env: COSIGN_KEY_LOCATION: /tmp/cosign.key COSIGN_PWD: ${{ secrets.COSIGN_PWD }} - + if: contains('["wiliansilvazup","matheusalcantarazup","lucasbrunozup","nathanmartinszup","iancardosozup","oliveirafelipezup"]', github.actor) steps: - name: Checkout uses: actions/checkout@v2 @@ -95,6 +96,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COSIGN_PWD: ${{ secrets.COSIGN_PWD }} GORELEASER_CURRENT_TAG: ${{ steps.updated-version.outputs.nextBetaVersion }} + GORELEASER_PREVIOUS_TAG: ${{ steps.updated-version.outputs.actualBetaVersion }} CURRENT_DATE: ${{ steps.date.outputs.date }} CLI_VERSION: ${{ steps.updated-version.outputs.nextBetaVersion }} diff --git a/.github/workflows/release-new.yml b/.github/workflows/release-final.yml similarity index 90% rename from .github/workflows/release-new.yml rename to .github/workflows/release-final.yml index febdc24ff..e2935fc01 100644 --- a/.github/workflows/release-new.yml +++ b/.github/workflows/release-final.yml @@ -11,7 +11,7 @@ # 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-new +name: release-final on: workflow_dispatch: inputs: @@ -20,16 +20,16 @@ on: required: true permissions: read-all jobs: - NewRelease: + ReleaseFinal: permissions: contents: write packages: write + issues: write runs-on: ubuntu-latest env: COSIGN_KEY_LOCATION: /tmp/cosign.key COSIGN_PWD: ${{ secrets.COSIGN_PWD }} - - + if: contains('["wiliansilvazup","matheusalcantarazup","lucasbrunozup","nathanmartinszup","iancardosozup","oliveirafelipezup"]', github.actor) steps: - name: Checkout uses: actions/checkout@v2 @@ -87,6 +87,9 @@ jobs: - name: Create local tag run: mage -v createLocalTag ${{ steps.updated-version.outputs.nextReleaseVersion }} + - name: Push tag + run: git push --tags + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: @@ -97,6 +100,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COSIGN_PWD: ${{ secrets.COSIGN_PWD }} GORELEASER_CURRENT_TAG: ${{ steps.updated-version.outputs.nextReleaseVersion }} + GORELEASER_PREVIOUS_TAG: ${{ steps.updated-version.outputs.actualReleaseVersion }} CURRENT_DATE: ${{ steps.date.outputs.date }} CLI_VERSION: ${{ steps.updated-version.outputs.nextReleaseVersion }} diff --git a/.github/workflows/release-rc.yml b/.github/workflows/release-rc.yml index a872f2795..a3faaceba 100644 --- a/.github/workflows/release-rc.yml +++ b/.github/workflows/release-rc.yml @@ -20,16 +20,16 @@ on: required: true permissions: read-all jobs: - Rc: + ReleaseRc: permissions: contents: write packages: write + issues: write runs-on: ubuntu-latest env: COSIGN_KEY_LOCATION: /tmp/cosign.key COSIGN_PWD: ${{ secrets.COSIGN_PWD }} - - + if: contains('["wiliansilvazup","matheusalcantarazup","lucasbrunozup","nathanmartinszup","iancardosozup","oliveirafelipezup"]', github.actor) steps: - name: Checkout uses: actions/checkout@v2 @@ -82,7 +82,7 @@ jobs: HORUSEC_REPOSITORY_NAME: ${{ github.event.repository.name }} - name: Checkout release branch run: mage -v checkoutReleaseBranch ${{ steps.updated-version.outputs.nextReleaseBranchName }} - + - name: Create local tag run: mage -v createLocalTag ${{ steps.updated-version.outputs.nextRCVersion }} @@ -96,6 +96,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COSIGN_PWD: ${{ secrets.COSIGN_PWD }} GORELEASER_CURRENT_TAG: ${{ steps.updated-version.outputs.nextRCVersion }} + GORELEASER_PREVIOUS_TAG: ${{ steps.updated-version.outputs.actualRCVersion }} CURRENT_DATE: ${{ steps.date.outputs.date }} CLI_VERSION: ${{ steps.updated-version.outputs.nextRCVersion }} diff --git a/goreleaser.yml b/goreleaser.yml index af7ff85e1..a4485aebe 100644 --- a/goreleaser.yml +++ b/goreleaser.yml @@ -30,7 +30,7 @@ builds: goarch: - amd64 - arm64 - - 386 + - "386" binary: horusec_{{ replace (replace .Os "windows" "win") "darwin" "mac" }}_{{ replace .Arch "386" "x86" }} - id: horusec-standalone env: [ CGO_ENABLED=0 ] @@ -48,10 +48,30 @@ builds: goarch: - amd64 - arm64 - - 386 + - "386" binary: horusec_{{ replace (replace .Os "windows" "win") "darwin" "mac" }}_{{ replace .Arch "386" "x86" }}_stand_alone changelog: - skip: true + skip: false + use: git + groups: + - title: 'Features' + regexp: "^.*:(feature|feat)\\s-.*$" + order: 0 + - title: 'Bug fixes' + regexp: "^.*:(bugfix|fix)\\s-.*$" + order: 1 + - title: 'Hotfixes' + regexp: "^.*:hotfix\\s-.*$" + order: 2 + - title: 'Chores' + regexp: "^.*:chore\\s-.*$" + order: 3 + - title: Others + order: 999 + filters: + exclude: + - '^deps:chore.*$' + - '^build(deps):.*$' snapshot: name_template: '{{ incpatch .Tag }}' archives: @@ -80,7 +100,13 @@ archives: checksum: name_template: 'checksums.txt' release: - draft: true + draft: false + mode: append + footer: | + ## Docker images + - `docker pull horuszup/horusec-cli:{{ .Tag }}` + + **Full Changelog**: https://github.com/ZupIT/horusec/compare/{{ .PreviousTag }}...{{ .Tag }} extra_files: - glob: deployments/cosign.pub nfpms: @@ -120,7 +146,7 @@ docker_signs: dockers: - image_templates: - 'horuszup/horusec-cli:{{ .Tag }}-amd64' - skip_push: false + skip_push: "false" goos: linux goarch: amd64 dockerfile: ./deployments/Dockerfile-gorelease-amd64 @@ -136,7 +162,7 @@ dockers: - --tls-verify=false - image_templates: - 'horuszup/horusec-cli:{{ .Tag }}-arm64' - skip_push: false + skip_push: "false" goos: linux goarch: arm64 dockerfile: ./deployments/Dockerfile-gorelease-arm64