Skip to content

Commit

Permalink
feat(pipelines): added the workflow to have a complete pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Rios <[email protected]>
  • Loading branch information
rios0rios0 committed Feb 9, 2024
1 parent e3fb61f commit 4925d2a
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 30 deletions.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions .github/pull_request_template/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## :vertical_traffic_light: Quality checklist

- [ ] Did you add the changes in the `CHANGELOG.md`?
- [ ] Did you run all the code checks? (`go test`)
- [ ] Are the tests passing?
23 changes: 23 additions & 0 deletions .github/workflows/default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'default'

on:
push:
branches:
- 'main'
tags:
- '*'
pull_request:
branches:
- 'main'
workflow_dispatch:

permissions:
checks: 'write' # code_check-style_golangci_lint
contents: 'write' # delivery-release

jobs:
default:
uses: 'rios0rios0/pipelines/.github/workflows/go-docker.yaml@feat/#19'


#
58 changes: 29 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
name: release
name: 'release'
on:
push:
tags:
- "*"

permissions:
contents: write
contents: 'write'

jobs:
setup:
name: Setup
runs-on: ubuntu-22.04
name: 'Setup'
runs-on: 'ubuntu-22.04'
outputs:
VERSION: ${{ steps.get_version.outputs.VERSION }}
steps:
- name: Get version
id: get_version
- name: 'Get version'
id: 'get_version'
run: echo VERSION=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT

build:
name: Build
needs: [setup]
runs-on: ubuntu-22.04
name: 'Build'
needs: ['setup']
runs-on: 'ubuntu-22.04'
env:
PACKAGENAME: autobump-${{ needs.setup.outputs.VERSION }}
DEBIAN_FRONTEND: noninteractive
DEBIAN_FRONTEND: 'noninteractive'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: 'Checkout repository'
uses: 'actions/checkout@v3'
with:
ref: ${{ needs.setup.outputs.VERSION }}
submodules: recursive
- name: Install dependencies
submodules: 'recursive'
- name: 'Install dependencies'
run: |
sudo apt-get update
sudo apt-get install -y golang
Expand All @@ -43,16 +43,16 @@ jobs:
run: |
cd bin
zip -9 ${{ env.PACKAGENAME }}.zip autobump
- name: Upload artifact
- name: 'Upload artifact'
uses: actions/upload-artifact@v2
with:
name: autobump
name: 'autobump'
path: bin/${{ env.PACKAGENAME }}.zip

create-release:
name: Create Release
needs: [setup, build]
runs-on: ubuntu-22.04
name: 'Create Release'
needs: ['setup', 'build']
runs-on: 'ubuntu-22.04'
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
Expand All @@ -66,23 +66,23 @@ jobs:
prerelease: false

upload:
name: Upload
needs: [setup, build, create-release]
runs-on: ubuntu-22.04
name: 'Upload'
needs: ['setup', 'build', 'create-release']
runs-on: 'ubuntu-22.04'
env:
PACKAGENAME: autobump-${{ needs.setup.outputs.VERSION }}
DEBIAN_FRONTEND: noninteractive
DEBIAN_FRONTEND: 'noninteractive'
steps:
- name: Download artifact
uses: actions/download-artifact@v2
- name: 'Download artifact'
uses: 'actions/download-artifact@v2'
with:
name: autobump
- name: Upload release asset
uses: actions/upload-release-asset@v1
name: 'autobump'
- name: 'Upload release asset'
uses: 'actions/upload-release-asset@v1'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ env.PACKAGENAME }}.zip
asset_name: ${{ env.PACKAGENAME }}.zip
asset_content_type: application/zip
asset_content_type: 'application/zip'
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ Exceptions are acceptable depending on the circumstances (critical bug fixes tha

## [Unreleased]

### Added

- added the workflow to have a complete pipeline with security and quality checks

### Changed

- increment the version number only by one since it is the more common practice and eliminate discontinuity in the version numbers
- changed to increment the version number only by one since it is the most common practice and eliminates discontinuity in the version numbers

### Fixed

Expand Down
4 changes: 4 additions & 0 deletions horusec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"horusecCliFalsePositiveHashes": [],
"horusecCliRiskAcceptHashes": []
}

0 comments on commit 4925d2a

Please sign in to comment.