-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(releaser): trigger charts releaser workflow on new release (#6732)
### 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
1 parent
93e9d15
commit 196b17d
Showing
2 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
.github/workflows/releaser-signoz.yaml → .github/workflows/prereleaser.yaml
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,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\"}}" |