Skip to content

Commit

Permalink
ci(releaser): trigger charts releaser workflow on new release (#6732)
Browse files Browse the repository at this point in the history
### Summary

- GH workflow to trigger releaser workflow in charts repository on new SigNoz release

Signed-off-by: Prashant Shahi <prashant@signoz.io>
  • Loading branch information
prashant-shahi authored Dec 30, 2024
1 parent 93e9d15 commit 196b17d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: releaser-signoz
name: prereleaser

on:
# schedule every wednesday 9:30 AM UTC (3pm IST)
schedule:
- cron: '30 9 * * 3'

# allow manual triggering of the workflow by a maintainer with no inputs
# allow manual triggering of the workflow by a maintainer
workflow_dispatch:
inputs:
release_type:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/releaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: releaser

on:
# trigger on new latest release
release:
types: [published]

jobs:
charts:
runs-on: ubuntu-latest
steps:
- id: token
name: github-token-gen
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.PRIMUS_APP_ID }}
private-key: ${{ secrets.PRIMUS_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: trigger-charts-prereleaser
run: |
# Variables
repo_owner="signoz"
repo_name="charts"
event_type="prereleaser"
# identify the release type
release_tag=${{ github.event.release.tag_name }}
patch_number=$(echo $release_tag | awk -F. '{print $3}')
release_type="minor"
if [[ $patch_number -ne 0 ]]; then
release_type="patch"
fi
# trigger the releaser workflow in signoz/charts repo
curl -L -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ steps.token.outputs.token }}" \
"https://api.github.com/repos/${repo_owner}/${repo_name}/dispatches" \
-d "{\"event_type\": \"$event_type\", \"client_payload\": {\"release_type\": \"$release_type\"}}"

0 comments on commit 196b17d

Please sign in to comment.