Skip to content

Commit

Permalink
workflow:feat - Automating the release body
Browse files Browse the repository at this point in the history
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 <wilian.silva@zup.com.br>
  • Loading branch information
wiliansilvazup committed Feb 21, 2022
1 parent f860773 commit 5de57c0
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 22 deletions.
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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 }}

Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}

Expand All @@ -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 }}

Expand Down
38 changes: 32 additions & 6 deletions goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 5de57c0

Please sign in to comment.