-
Notifications
You must be signed in to change notification settings - Fork 3
66 lines (62 loc) · 1.92 KB
/
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
name: Publish Release
on:
#
# Execute the workflow only if build and deploy was successful
# By dependency this workflow should only execute after a push to main
#
workflow_run:
workflows:
- "Build and Deploy"
types:
- completed
jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
if: contains( join(github.event.commits.*.message), 'New blog post')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: 'x64'
cache: 'pip'
- shell: bash
run: |
python -m pip install -r scripts/requirements.txt
python scripts/get_release_info.py
- uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: post-${{ env.BLOG_POST_SLUG_TITLE }}
body: |
New blog post released: `${{ env.BLOG_POST_TITLE }}`
Link: ${{ env.BLOG_POST_URL }}
create_discussion:
name: Create Discussion
runs-on: ubuntu-latest
if: contains( join(github.event.commits.*.message), 'New blog post')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: 'x64'
cache: 'pip'
- shell: bash
run: |
python -m pip install -r scripts/requirements.txt
python scripts/get_release_info.py
- name: Create the new GitHub Discussion
uses: abirismyname/[email protected]
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: ${{ env.BLOG_POST_TITLE }}
body: |
> ${{ env.BLOG_POST_SUMMARY }}
[Link](BLOG_POST_URL)
repository-id: ${{ secrets.DISCUSSION_REPOSITORY_ID }}
category-id: ${{ secrets.DISCUSSION_CATEGORY_ID }}