-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add support for testing release workflow
Signed-off-by: Carlos Salas <carlos.salas@suse.com>
- Loading branch information
1 parent
bc71982
commit f516c19
Showing
2 changed files
with
129 additions
and
14 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,127 @@ | ||
name: Test release process nightly | ||
|
||
on: | ||
push: | ||
branches: | ||
- run-release-workflow-periodically | ||
schedule: | ||
- cron: "0 0 * * *" # Run every day at midnight (UTC) | ||
workflow_dispatch: # Allow running manually on demand | ||
|
||
env: | ||
RELEASE_TAG: t9.9.9-fake | ||
|
||
jobs: | ||
nightly-test-release: | ||
name: Tag current version for testing | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: main | ||
fetch-depth: 0 | ||
- name: Set and push fake tag for release | ||
run: | | ||
git tag ${{ env.RELEASE_TAG }} | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
tags: true | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build-push-services: | ||
name: Build, sign and provenance | ||
needs: [nightly-test-release] | ||
permissions: | ||
actions: read | ||
contents: write | ||
packages: write | ||
id-token: write | ||
strategy: | ||
matrix: | ||
destination: [ghcr] | ||
arch: [amd64, arm64, s390x] | ||
include: | ||
- destination: ghcr | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: GITHUB_TOKEN | ||
uses: ./.github/workflows/release-workflow.yml | ||
with: | ||
password: ${{ matrix.password }} | ||
username: ${{ matrix.username }} | ||
registry: ${{ matrix.registry }} | ||
tag: t9.9.9-fake | ||
arch: ${{ matrix.arch }} | ||
org: "salasberryfin" #### TBD | ||
secrets: | ||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }} | ||
|
||
release: | ||
name: Create helm release | ||
needs: [build-push-services] | ||
runs-on: ubuntu-latest | ||
env: | ||
PROD_REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} | ||
PROD_ORG: rancher-sandbox | ||
RELEASE_DIR: .cr-release-packages | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.RELEASE_TAG }} | ||
fetch-depth: 0 | ||
- name: Package operator chart | ||
run: RELEASE_TAG=${{ env.RELEASE_TAG }} CHART_PACKAGE_DIR=${RELEASE_DIR} REGISTRY=${{ env.PROD_REGISTRY }} ORG=${{ env.PROD_ORG }} make release | ||
|
||
notify-failure: | ||
name: Notify failure in Slack | ||
needs: [release] | ||
if: failure() | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: slackapi/slack-github-action@v1.24.0 | ||
with: | ||
payload: | | ||
{ | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "Rancher turtles RELEASE test failed." | ||
}, | ||
"accessory": { | ||
"type": "button", | ||
"text": { | ||
"type": "plain_text", | ||
"text": ":github:", | ||
"emoji": true | ||
}, | ||
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
} | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
|
||
clean-up: | ||
name: Release testing clean up | ||
needs: [release] | ||
if: always() | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: dev-drprasad/delete-tag-and-release@v1.0 | ||
with: | ||
tag_name: ${{ env.RELEASE_TAG }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
delete_release: false |
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