mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-06-04 11:25:52 +08:00
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>
This commit is contained in:
parent
93e9d15004
commit
196b17dd1e
@ -1,11 +1,11 @@
|
|||||||
name: releaser-signoz
|
name: prereleaser
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# schedule every wednesday 9:30 AM UTC (3pm IST)
|
# schedule every wednesday 9:30 AM UTC (3pm IST)
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '30 9 * * 3'
|
- 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:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
release_type:
|
release_type:
|
39
.github/workflows/releaser.yaml
vendored
Normal file
39
.github/workflows/releaser.yaml
vendored
Normal file
@ -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\"}}"
|
Loading…
x
Reference in New Issue
Block a user