-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci/cd): include release toolkit (#72)
* feat(ci/cd): include release toolkit Co-authored-by: Juan Manuel "Kang" Pérez <[email protected]> --------- Co-authored-by: Juan Manuel "Kang" Pérez <[email protected]>
- Loading branch information
1 parent
ba93daf
commit e87648b
Showing
10 changed files
with
129 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extends": [ | ||
"github>newrelic/coreint-automation:renovate-base.json5" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Prerelease pipeline | ||
name: Create prerelease artifacts | ||
|
||
on: | ||
release: | ||
|
@@ -15,20 +15,6 @@ env: | |
TAG: ${{ github.event.release.tag_name }} | ||
|
||
jobs: | ||
snyk: | ||
name: Run security checks via snyk | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.OHAI_DOCKER_HUB_ID }} | ||
password: ${{ secrets.OHAI_DOCKER_HUB_PASSWORD }} | ||
- name: Scan code for vulnerabilities | ||
env: | ||
SNYK_TOKEN: ${{ secrets.COREINT_SNYK_TOKEN }} | ||
run: make ci/snyk-test | ||
|
||
test-nix: | ||
name: Run unit tests on *Nix | ||
|
@@ -68,7 +54,7 @@ jobs: | |
prerelease: | ||
name: Build binary for *Nix/Win, create archives for *Nix/Win, create packages for *Nix, upload all artifacts into GH Release assets | ||
runs-on: ubuntu-20.04 | ||
needs: [test-nix, test-windows, snyk] | ||
needs: [test-nix, test-windows] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Login to DockerHub | ||
|
@@ -82,13 +68,6 @@ jobs: | |
GPG_MAIL: '[email protected]' | ||
GPG_PASSPHRASE: ${{ secrets.OHAI_GPG_PASSPHRASE }} | ||
GPG_PRIVATE_KEY_BASE64: ${{ secrets.OHAI_GPG_PRIVATE_KEY_BASE64 }} # base64 encoded | ||
- name: Notify failure via Slack | ||
if: ${{ failure() }} | ||
uses: archive/github-actions-slack@master | ||
with: | ||
slack-bot-user-oauth-access-token: ${{ secrets.COREINT_SLACK_TOKEN }} | ||
slack-channel: ${{ secrets.COREINT_SLACK_CHANNEL }} | ||
slack-text: "❌ `${{ env.REPO_FULL_NAME }}`: prerelease pipeline failed." | ||
- name: Test package installability | ||
uses: newrelic/integrations-pkg-test-action/linux@v1 | ||
with: | ||
|
@@ -139,13 +118,6 @@ jobs: | |
shell: bash | ||
run: | | ||
build/windows/upload_msi.sh ${INTEGRATION} ${{ matrix.goarch }} ${TAG} | ||
- name: Notify failure via Slack | ||
if: ${{ failure() }} | ||
uses: archive/github-actions-slack@master | ||
with: | ||
slack-bot-user-oauth-access-token: ${{ secrets.COREINT_SLACK_TOKEN }} | ||
slack-channel: ${{ secrets.COREINT_SLACK_CHANNEL }} | ||
slack-text: "❌ `${{ env.REPO_FULL_NAME }}`: prerelease pipeline failed." | ||
publish-to-s3: | ||
name: Send release assets to S3 | ||
|
@@ -190,3 +162,15 @@ jobs: | |
packageLocation: repo | ||
stagingRepo: true | ||
upgrade: false | ||
|
||
notify-failure: | ||
if: ${{ always() && failure() }} | ||
needs: [test-nix, test-windows, prerelease, package-win, publish-to-s3] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Notify failure via Slack | ||
uses: archive/github-actions-slack@master | ||
with: | ||
slack-bot-user-oauth-access-token: ${{ secrets.COREINT_SLACK_TOKEN }} | ||
slack-channel: ${{ secrets.COREINT_SLACK_CHANNEL }} | ||
slack-text: "❌ `${{ env.ORIGINAL_REPO_NAME }}`: [prerelease pipeline failed](${{ github.server_url }}/${{ env.ORIGINAL_REPO_NAME }}/actions/runs/${{ github.run_id }})." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Security Scan | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- renovate/** | ||
pull_request: | ||
schedule: | ||
- cron: "0 3 * * *" | ||
|
||
jobs: | ||
trivy: | ||
name: Trivy security scan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run Trivy vulnerability scanner in repo mode | ||
uses: aquasecurity/[email protected] | ||
if: ${{ ! github.event.schedule }} # Do not run inline checks when running periodically | ||
with: | ||
scan-type: fs | ||
ignore-unfixed: true | ||
exit-code: 1 | ||
severity: 'HIGH,CRITICAL' | ||
skip-dirs: 'build' | ||
# test private key | ||
skip-files: 'tests/integration/tls_cert/redis.key' | ||
|
||
- name: Run Trivy vulnerability scanner sarif output | ||
uses: aquasecurity/[email protected] | ||
if: ${{ github.event.schedule }} # Generate sarif when running periodically | ||
with: | ||
scan-type: fs | ||
ignore-unfixed: true | ||
severity: 'HIGH,CRITICAL' | ||
format: 'template' | ||
template: '@/contrib/sarif.tpl' | ||
output: 'trivy-results.sarif' | ||
skip-dirs: 'build' | ||
# test private key | ||
skip-files: 'tests/integration/tls_cert/redis.key' | ||
|
||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v2 | ||
if: ${{ github.event.schedule }} # Upload sarif when running periodically | ||
with: | ||
sarif_file: 'trivy-results.sarif' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Trigger prerelease creation | ||
|
||
# This workflow triggers a prerelease creation with changelog and the release notes created by the release toolkit. | ||
# This workflow should be triggered merely from the default branch. | ||
# If you wish to be 100% free creating a prerelease, just create it manually. | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 5 * * 4" | ||
|
||
jobs: | ||
prerelease: | ||
uses: newrelic/coreint-automation/.github/workflows/trigger_prerelease.yaml@v1 | ||
secrets: | ||
bot_token: ${{ secrets.COREINT_BOT_TOKEN }} | ||
slack_channel: ${{ secrets.COREINT_SLACK_CHANNEL }} | ||
slack_token: ${{ secrets.COREINT_SLACK_TOKEN }} | ||
with: | ||
rt-included-files: go.mod,go.sum,build/Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM golang:1.20-buster | ||
FROM golang:1.20.6-bookworm | ||
|
||
ARG GH_VERSION='1.9.2' | ||
|
||
|