Skip to content

Commit 346dd11

Browse files
authored
Improve newsletter create action (#1472)
* General action fixes * Fix dates * Fix separator * Fix post date
1 parent 7d71de9 commit 346dd11

File tree

4 files changed

+23
-40
lines changed

4 files changed

+23
-40
lines changed

.github/create_newsletter_scaffold.sh

-6
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ if [[ -z "${NEWSLETTER_YEAR}" ]]; then
1212
exit 1
1313
fi
1414

15-
if [[ -z "${NEWSLETTER_DEADLINE}" ]]; then
16-
echo "NEWSLETTER_DEADLINE is not set. Exiting..."
17-
exit 1
18-
fi
19-
2015
if [[ -z "${NEWSLETTER_COUNTER}" ]]; then
2116
echo "NEWSLETTER_COUNTER is not set. Exiting..."
2217
exit 1
@@ -25,7 +20,6 @@ fi
2520
cp .github/newsletter-template.md index.md
2621
sed -i "s/{{\s*NEWSLETTER_MONTH\s*}}/${NEWSLETTER_MONTH}/g" index.md
2722
sed -i "s/{{\s*NEWSLETTER_YEAR\s*}}/${NEWSLETTER_YEAR}/g" index.md
28-
sed -i "s/{{\s*NEWSLETTER_DEADLINE\s*}}/${NEWSLETTER_DEADLINE}/g" index.md
2923
sed -i "s/{{\s*NEWSLETTER_COUNTER\s*}}/${NEWSLETTER_COUNTER}/g" index.md
3024
# Create a dir in content/news with the counter with 3 digits as name
3125
destination="content/news/$(printf "%03d" ${NEWSLETTER_COUNTER})"

.github/newsletter-issue-template.md

+15-27
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,15 @@ newsletter with {{ env.NEWSLETTER_MONTH }}'s news!
1313

1414
## Current Schedule
1515

16-
The deadline for all section PRs is the **03.{{ env.NEWSLETTER_DEADLINE }}**
16+
The deadline for all section PRs is the **3rd of {{ env.NEWSLETTER_NEXT_MONTH}}, {{ env.NEWSLETTER_YEAR }}**
1717

18-
We _may_ still accept PRs that are submitted later than this, as long as they're
19-
ready before the newsletter's release, but this isn't guaranteed.
20-
If you want your section to be included, don't leave it till the last minute!
18+
We _may_ still accept PRs that are submitted later than this, as long as they're ready before the newsletter's release, but this isn't guaranteed. If you want your section to be included, don't leave it till the last minute!
2119

2220
## Current Structure & Status
2321

24-
Below is our current planned structure for the newsletter,
25-
and the status of each PR (which we'll try to keep updated).
22+
Below is our current planned structure for the newsletter, and the status of each PR (which we'll try to keep updated).
2623

27-
This is **not** an exhaustive list - if you have your own project that you want
28-
to write about, just make a comment on this issue and open a PR!
24+
This is **not** an exhaustive list - if you have your own project that you want to write about, just make a comment on this issue and open a PR!
2925

3026
### Game Updates
3127

@@ -57,31 +53,23 @@ to write about, just make a comment on this issue and open a PR!
5753

5854
## Publishing Steps
5955

60-
- [ ] Final review - by everyone
61-
- [ ] Publish - by @janhohenheim
62-
- [ ] Post on /r/rust, /r/rust_gamedev, /r/gamedev, URLO - by @janhohenheim
63-
- [ ] Pin thread on Twitter - by @AngelOnFira
64-
- [ ] Add comment links - by @AngelOnFira
56+
- [ ] Final review - by everyone
57+
- [ ] Publish - by @janhohenheim
58+
- [ ] Post on /r/rust, /r/rust_gamedev, /r/gamedev, URLO - by @janhohenheim
59+
- [ ] Pin thread on Twitter - by @AngelOnFira
60+
- [ ] Add comment links - by @AngelOnFira
6561

6662
## How to Contribute
6763

6864
If you want to help writing the newsletter:
6965

7066
- **Read [CONTRIBUTING.md](https://github.com/rust-gamedev/rust-gamedev.github.io/blob/source/CONTRIBUTING.md?rgh-link-date=2023-09-12T16%3A17%3A34Z).**
71-
- Choose one or more of the "🆓 **free**" sections listed below, and leave a
72-
comment letting us know you want to work on them.
73-
- The links in brackets (like `[1](#), [2](#), [3](#)`) are suggestions of
74-
links to include in the section. Feel free to add more!
75-
- The username listed next to the section (like `@janhohenheim?`) is a
76-
suggestion of who may want to pick up the work (usually the project's
77-
developer, or someone who has expressed interest in the past).
78-
- You are not obligated to write a section if you're tagged or your project
79-
is listed! You're welcome to ask someone else to write the section,
80-
or to ask for your project to be excluded from this month's post.
81-
- Extra sections not listed in the plan are welcomed -
82-
just leave a comment and open a PR!
83-
- Write a short overview in the newsletter's Markdown file,
84-
making sure to follow the style guidelines (see below).
67+
- Choose one or more of the "🆓 **free**" sections listed below, and leave a comment letting us know you want to work on them.
68+
- The links in brackets (like `[1](#), [2](#), [3](#)`) are suggestions of links to include in the section. Feel free to add more!
69+
- The username listed next to the section (like `@janhohenheim?`) is a suggestion of who may want to pick up the work (usually the project's developer, or someone who has expressed interest in the past).
70+
- You are not obligated to write a section if you're tagged or your project is listed! You're welcome to ask someone else to write the section, or to ask for your project to be excluded from this month's post.
71+
- Extra sections not listed in the plan are welcomed - just leave a comment and open a PR!
72+
- Write a short overview in the newsletter's Markdown file, making sure to follow the style guidelines (see below).
8573
- Send a PR _to the `source` branch_ (example: [N15: A/B Street #336](https://github.com/rust-gamedev/rust-gamedev.github.io/pull/336)).
8674
- Mention this issue in your PR's description to link it all together.
8775

.github/newsletter-template.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
+++
22
title = "This Month in Rust GameDev #{{ NEWSLETTER_COUNTER }} - {{ NEWSLETTER_MONTH }} {{ NEWSLETTER_YEAR }}"
33
transparent = true
4-
date = {{ NEWSLETTER_DEADLINE }}
4+
date = {{ NEWSLETTER_YEAR }}-{{ NEWSLETTER_NEXT_MONTH_NUMBER }}-03
55
draft = true
66
+++
77

@@ -35,8 +35,8 @@ Feel free to send PRs about your own projects!
3535
- [Learning Material Updates](#learning-material-updates)
3636
- [Tooling Updates](#tooling-updates)
3737
- [Library Updates](#library-updates)
38-
- [Other News](#other-news)
3938
- [Popular Workgroup Issues in GitHub](#popular-workgroup-issues-in-github)
39+
- [Other News](#other-news)
4040
- [Meeting Minutes](#meeting-minutes)
4141
- [Discussions](#discussions)
4242
- [Requests for Contribution](#requests-for-contribution)

.github/workflows/create-newsletter.yaml

+6-5
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ jobs:
1919
- name: Set environment variables
2020
run: |
2121
echo "NEWSLETTER_MONTH=$(date +'%B')" >> $GITHUB_ENV
22+
echo "NEWSLETTER_NEXT_MONTH=$(date -d' 1 month ' +'%B')" >> $GITHUB_ENV
23+
echo "NEWSLETTER_NEXT_MONTH_NUMBER=$(date -d' 1 month ' +'%m')" >> $GITHUB_ENV
2224
echo "NEWSLETTER_YEAR=$(date +'%Y')" >> $GITHUB_ENV
23-
echo "NEWSLETTER_DEADLINE=$(date -d' 1 month ' '+%m.%Y')" >> $GITHUB_ENV
2425
# take the amount of months since feb 2024 and add 50
25-
echo "NEWSLETTER_COUNTER=$(( ( ( $(date +'%Y') - 2024 ) * 12 + $(date +'%m') - 2 ) + 50 ))" >> $GITHUB_ENV
26+
echo "NEWSLETTER_COUNTER=$(( ( ( $(date +'%Y') - 2024 ) * 12 + $(date +'%m') - 4 ) + 50 ))" >> $GITHUB_ENV
2627
- name: Create newsletter scaffold
2728
run: ./.github/create_newsletter_scaffold.sh
2829
- name: Commit and create pull request
@@ -33,9 +34,9 @@ jobs:
3334
title: "Newsletter N${{ env.NEWSLETTER_COUNTER }} for ${{ env.NEWSLETTER_MONTH }} ${{ env.NEWSLETTER_YEAR }}"
3435
body: "This PR adds the initial newsletter source file for ${{ env.NEWSLETTER_MONTH }} ${{ env.NEWSLETTER_YEAR }}."
3536
assignees: |
36-
AngelOnFira
37-
janhohenheim
38-
mamaicode
37+
AngelOnFira
38+
janhohenheim
39+
mamaicode
3940
- name: Create tracking issue
4041
uses: JasonEtco/create-an-issue@v2
4142
env:

0 commit comments

Comments
 (0)