File tree 3 files changed +49
-4
lines changed
3 files changed +49
-4
lines changed Original file line number Diff line number Diff line change
1
+ name : Prepare a new newsletter
2
+
3
+ on : workflow_dispatch
4
+
5
+ jobs :
6
+ prepare_new_newsletter :
7
+ runs-on : ubuntu-latest
8
+ env :
9
+ # https://github.com/crazy-max/ghaction-github-pages/issues/1#issuecomment-623202206
10
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
11
+ steps :
12
+ - uses : actions/checkout@v2
13
+ - run : ./zola --version
14
+ - name : copy template and adapt dates and ids.
15
+ run : echo y | ./scripts/prepare_newsletter.sh
16
+ env :
17
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
18
+ - name : create pull request
19
+ run : gh pr create -B source -H new_newsletter --title 'Prepare new newsletter' --body 'Created by Github action'
20
+ env :
21
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1
1
+++
2
- title = " This Month in Rust GameDev #{TODO } - {TODO } {TODO }"
2
+ title = " This Month in Rust GameDev #{TODO_id } - {TODO_month } {TODO_day }"
3
3
transparent = true
4
- date = T ODO
4
+ date = {TODO_date}
5
5
draft = true
6
6
+++
7
7
8
8
<!-- no toc -->
9
9
10
10
<!-- Check the post with markdownlint-->
11
11
12
- Welcome to the {TODO }th issue of the Rust GameDev Workgroup's
12
+ Welcome to the {TODO_id }th issue of the Rust GameDev Workgroup's
13
13
monthly newsletter.
14
14
[ Rust] is a systems language pursuing the trifecta:
15
15
safety, concurrency, and speed.
@@ -35,8 +35,8 @@ Feel free to send PRs about your own projects!
35
35
- [ Learning Material Updates] ( #learning-material-updates )
36
36
- [ Tooling Updates] ( #tooling-updates )
37
37
- [ Library Updates] ( #library-updates )
38
- - [ Other News] ( #other-news )
39
38
- [ Popular Workgroup Issues in Github] ( #popular-workgroup-issues-in-github )
39
+ - [ Other News] ( #other-news )
40
40
- [ Meeting Minutes] ( #meeting-minutes )
41
41
- [ Discussions] ( #discussions )
42
42
- [ Requests for Contribution] ( #requests-for-contribution )
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ # This scripts parses existing news, and copies the newsletter template
4
+ # alongside the others, with its incremented id number.
5
+ # This script also replaces the TODOs related to the news id number.
6
+
7
+ read -r -d ' \n' -a news <<< ` find content/news/ -type d -printf " %f\n" `
8
+
9
+ last_news=` echo ${news[-1]} | sed -r s/0//`
10
+ echo $last_news
11
+ news_to_create_simple=$(( last_news+ 1 ))
12
+ news_to_create=` printf " %#03s" $news_to_create_simple `
13
+
14
+ read -e -p " Do you want to create issue $news_to_create ? (y/n): " choice
15
+
16
+ [[ " $choice " != [Yy]* ]] && exit
17
+
18
+ echo " accepted"
19
+
20
+ new_file=" content/news/$news_to_create /index.md"
21
+
22
+ mkdir -p content/news/$news_to_create && cp -r newsletter-template.md $new_file
23
+
24
+ sed -i ' s/{TODO_id}/' $news_to_create_simple ' /g' $new_file
You can’t perform that action at this time.
0 commit comments