generated from okp4/template-oss
-
Notifications
You must be signed in to change notification settings - Fork 128
153 lines (137 loc) Β· 5.33 KB
/
notify-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Notify release
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: "Release tag (leave empty for last one)"
jobs:
set-env:
runs-on: ubuntu-22.04
outputs:
tag: ${{ steps.set-env.outputs.tag }}
repo_name: ${{ steps.set-env.outputs.repo_name }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Expose tag and repo_name
id: set-env
run: |
if [ -n "$INPUT_TAG" ]; then
TAG="$INPUT_TAG"
else
TAG=$(gh release view --json tagName -q '.tagName')
fi
echo "tag=$TAG" >> $GITHUB_OUTPUT
REPO_NAME=${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}
echo "repo_name=$REPO_NAME" >> $GITHUB_OUTPUT
env:
INPUT_TAG: ${{ github.event.inputs.tag }}
GH_TOKEN: ${{ secrets.OPS_TOKEN }}
notify-github-discussion:
runs-on: ubuntu-22.04
needs: set-env
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Extract changelog for tag
run: |
{
echo 'CHANGELOG<<EOF'
gh release view ${{ needs.set-env.outputs.tag }} --json body -q '.body'
echo 'EOF'
} >> "$GITHUB_ENV"
env:
GH_TOKEN: ${{ secrets.OPS_TOKEN }}
- name: Create an announcement discussion for release
uses: abirismyname/[email protected]
with:
title: π ${{ needs.set-env.outputs.repo_name }} ${{ needs.set-env.outputs.tag }} released!
body: |
Hey frens! [${{ github.repository }}](https://github.com/${{ github.repository }}) `${{ needs.set-env.outputs.tag }}` just dropped! π
Some fresh updates are here. Dive into the changelog and see what's cooking! π₯
# Changelog
${{ env.CHANGELOG }}
# Resources
π Changelog: <https://github.com/${{ github.repository }}/releases/tag/${{ needs.set-env.outputs.tag }}>
π οΈ Official repo: <https://github.com/${{ github.repository }}>
π¬ Vibe with us on Discord: <${{ env.DISCORD_URL }}>
π¦ Catch us on Twitter: <${{ env.TWITTER_URL }}>
repository-id: ${{ env.REPOSITORY_ID }}
category-id: ${{ env.CATEGORY_ID }}
env:
GH_TOKEN: ${{ secrets.OPS_TOKEN }}
DISCORD_URL: ${{ vars.DISCORD_URL }}
TWITTER_URL: ${{ vars.TWITTER_URL }}
REPOSITORY_ID: ${{ vars.DISCUSSIONS_REPOSITORY_ID }}
CATEGORY_ID: ${{ vars.DISCUSSIONS_CATEGORY_ID }}
update-docs:
runs-on: ubuntu-22.04
if: github.event_name != 'workflow_dispatch'
steps:
- name: Update modules docs repository
uses: fjogeleit/http-request-action@v1
with:
url: "https://api.github.com/repos/axone-protocol/docs/actions/workflows/39152549/dispatches"
method: "POST"
customHeaders: '{"Accept": "application/vnd.github+json", "Authorization": "Bearer ${{ secrets.OPS_TOKEN }}"}'
data: |-
{
"ref": "main",
"inputs": {
"version": "${{ github.event.release.tag_name }}",
"repository": "${{github.repository}}",
"section": "modules",
"docs_directory": "docs/proto/*"
}
}
- name: Update commands docs repository
uses: fjogeleit/http-request-action@v1
with:
url: "https://api.github.com/repos/axone-protocol/docs/actions/workflows/39152549/dispatches"
method: "POST"
customHeaders: '{"Accept": "application/vnd.github+json", "Authorization": "Bearer ${{ secrets.OPS_TOKEN }}"}'
data: |-
{
"ref": "main",
"inputs": {
"version": "${{ github.event.release.tag_name }}",
"repository": "${{github.repository}}",
"section": "commands",
"docs_directory": "docs/command/*"
}
}
- name: Update predicates docs repository
uses: fjogeleit/http-request-action@v1
with:
url: "https://api.github.com/repos/axone-protocol/docs/actions/workflows/39152549/dispatches"
method: "POST"
customHeaders: '{"Accept": "application/vnd.github+json", "Authorization": "Bearer ${{ secrets.OPS_TOKEN }}"}'
data: |-
{
"ref": "main",
"inputs": {
"version": "${{ github.event.release.tag_name }}",
"repository": "${{github.repository}}",
"section": "predicates",
"docs_directory": "docs/predicate/*"
}
}
update-docs-version:
runs-on: ubuntu-22.04
if: github.event_name != 'workflow_dispatch'
steps:
- name: Update docs version
uses: fjogeleit/http-request-action@v1
with:
url: "https://api.github.com/repos/axone-protocol/docs/actions/workflows/98246586/dispatches"
method: "POST"
customHeaders: '{"Accept": "application/vnd.github+json", "Authorization": "Bearer ${{ secrets.OPS_TOKEN }}"}'
data: |-
{
"ref": "main",
"inputs": {
"axonedVersion": "${{ github.event.release.tag_name }}"
}
}