-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: migrate Codefresh pipelines to Github Actions (#68)
* ci: migrate Codefresh pipeline to Github Actions * ci: remove unused workflow_dispatch
- Loading branch information
1 parent
a4dae24
commit 35b05ef
Showing
5 changed files
with
275 additions
and
0 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,49 @@ | ||
name: Prepare Release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
prepare-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: main | ||
fetch-depth: 0 | ||
|
||
- name: Prepare release | ||
env: | ||
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} | ||
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | ||
GITHUB_TOKEN: ${{ secrets.TOKEN }} | ||
CI: true | ||
run: | | ||
echo "$GPG_SECRET_KEY" | base64 --decode | gpg --import --no-tty --batch --yes | ||
scripts/release.sh prepare | ||
- name: Notify Slack on Failure | ||
uses: slackapi/[email protected] | ||
if: failure() | ||
with: | ||
payload: | | ||
{ | ||
"attachments": [ | ||
{ | ||
"color": "#E92020", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "@oncall-growth-eng! There has been a failure that needs your attention. :rotating_light:\n*GitHub Workflow Failure*\nlw-scanner-action/prepare-release\n*Workflow Run*\n https://github.com/lacework/go-sdk/actions/runs/${{ github.run_id }}" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_GROWTH_ENG_ALERTS }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |
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,73 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Notify Slack on Release | ||
uses: slackapi/[email protected] | ||
with: | ||
payload: | | ||
{ | ||
"attachments": [ | ||
{ | ||
"color": "#E92020", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "Releasing the lw-scanner Github Action" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_GROWTH_ENG_ALERTS }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- name: Create Release | ||
env: | ||
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} | ||
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | ||
GITHUB_TOKEN: ${{ secrets.TOKEN }} | ||
run: | | ||
echo "$GPG_SECRET_KEY" | base64 --decode | gpg --import --no-tty --batch --yes | ||
scripts/release.sh publish | ||
- name: Notify Slack on Failure | ||
uses: slackapi/[email protected] | ||
if: failure() | ||
with: | ||
payload: | | ||
{ | ||
"attachments": [ | ||
{ | ||
"color": "#E92020", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "@oncall-growth-eng! There has been a failure that needs your attention. :rotating_light:\n*GitHub Workflow Failure*\nlw-scanner-action/release\n*Workflow Run*\n https://github.com/lacework/go-sdk/actions/runs/${{ github.run_id }}" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_GROWTH_ENG_ALERTS }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |
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,50 @@ | ||
name: Trigger Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
trigger-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: main | ||
token: ${{ secrets.TOKEN }} | ||
|
||
- name: Trigger release | ||
env: | ||
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} | ||
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | ||
CI: true | ||
run: | | ||
echo "$GPG_SECRET_KEY" | base64 --decode | gpg --import --no-tty --batch --yes | ||
scripts/release.sh trigger | ||
- name: Notify Slack on Failure | ||
uses: slackapi/[email protected] | ||
if: failure() | ||
with: | ||
payload: | | ||
{ | ||
"attachments": [ | ||
{ | ||
"color": "#E92020", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "@oncall-growth-eng! There has been a failure that needs your attention. :rotating_light:\n*GitHub Workflow Failure*\nlw-scanner-action/trigger-release\n*Workflow Run*\n https://github.com/lacework/go-sdk/actions/runs/${{ github.run_id }}" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_GROWTH_ENG_ALERTS }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |
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,54 @@ | ||
name: Update Docker Container Version | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
scanner_version: | ||
description: New lw-scanner version | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- name: Update Scanner Version | ||
env: | ||
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} | ||
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | ||
GITHUB_TOKEN: ${{ secrets.TOKEN }} | ||
run: | | ||
echo "$GPG_SECRET_KEY" | base64 --decode | gpg --import --no-tty --batch --yes | ||
export SCANNER_VERSION=${{inputs.scanner_version}} | ||
echo Version passed to script= $SCANNER_VERSION | ||
scripts/version-bump.sh $SCANNER_VERSION | ||
- name: Notify Slack on Failure | ||
uses: slackapi/[email protected] | ||
if: failure() | ||
with: | ||
payload: | | ||
{ | ||
"attachments": [ | ||
{ | ||
"color": "#E92020", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "@oncall-growth-eng! There has been a failure that needs your attention. :rotating_light:\n*GitHub Workflow Failure*\nlw-scanner-action/release\n*Workflow Run*\n https://github.com/lacework/go-sdk/actions/runs/${{ github.run_id }}" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_GROWTH_ENG_ALERTS }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |
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,49 @@ | ||
name: Verify Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- release | ||
|
||
jobs: | ||
verify-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.21.x | ||
|
||
- name: Verify release | ||
run: | | ||
scripts/release.sh verify | ||
- name: Notify Slack on Failure | ||
uses: slackapi/[email protected] | ||
if: failure() | ||
with: | ||
payload: | | ||
{ | ||
"attachments": [ | ||
{ | ||
"color": "#E92020", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "@oncall-growth-eng! There has been a failure that needs your attention. :rotating_light:\n*GitHub Workflow Failure*\nlw-scanner-action/verify-release\n*Workflow Run*\n https://github.com/lacework/go-sdk/actions/runs/${{ github.run_id }}" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_GROWTH_ENG_ALERTS }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |