-
Notifications
You must be signed in to change notification settings - Fork 343
Add GitHub Action for newsletter creation #1464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
9d729f1
8665ece
6aeb385
35c9f05
c6992da
8f0064e
d642ea7
05c91f9
f1b2a80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
if [[ -z "${NEWSLETTER_MONTH}" ]]; then | ||
echo "NEWSLETTER_MONTH is not set. Exiting..." | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "${NEWSLETTER_YEAR}" ]]; then | ||
echo "NEWSLETTER_YEAR is not set. Exiting..." | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "${NEWSLETTER_DEADLINE}" ]]; then | ||
echo "NEWSLETTER_DEADLINE is not set. Exiting..." | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "${NEWSLETTER_COUNTER}" ]]; then | ||
echo "NEWSLETTER_COUNTER is not set. Exiting..." | ||
exit 1 | ||
fi | ||
|
||
cp newsletter-template.md index.md | ||
sed -i "s/{{\s*NEWSLETTER_MONTH\s*}}/${NEWSLETTER_MONTH}/g" index.md | ||
sed -i "s/{{\s*NEWSLETTER_YEAR\s*}}/${NEWSLETTER_YEAR}/g" index.md | ||
sed -i "s/{{\s*NEWSLETTER_DEADLINE\s*}}/${NEWSLETTER_DEADLINE}/g" index.md | ||
sed -i "s/{{\s*NEWSLETTER_COUNTER\s*}}/${NEWSLETTER_COUNTER}/g" index.md | ||
# Create a dir in content/news with the counter with 3 digits as name | ||
destination="content/news/$(printf "%03d" ${NEWSLETTER_COUNTER})" | ||
mkdir -p $destination | ||
mv index.md $destination/index.md | ||
git status |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
--- | ||
title: "Newsletter {{ env.NEWSLETTER_COUNTER}}: {{ env.NEWSLETTER_MONTH }} {{ env.NEWSLETTER_YEAR }}" | ||
labels: coordination, help wanted | ||
assignees: janhohenheim | ||
--- | ||
|
||
###### tags: `newsletter` | ||
|
||
**Editors:** | ||
|
||
Another month has gone by, so it's time to put together the Rust Gamedev | ||
newsletter with {{ env.NEWSLETTER_MONTH }}'s news! | ||
|
||
## Current Schedule | ||
|
||
The deadline for all section PRs is the **03.{{ env.NEWSLETTER_DEADLINE }}** | ||
|
||
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! | ||
|
||
## Current Structure & Status | ||
|
||
Below is our current planned structure for the newsletter, | ||
and the status of each PR (which we'll try to keep updated). | ||
|
||
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! | ||
|
||
### Game Updates | ||
|
||
- TODO | ||
|
||
### Learning Material Updates | ||
|
||
- TODO | ||
|
||
### Engine Updates | ||
|
||
- TODO | ||
|
||
### Tooling Updates | ||
|
||
- TODO | ||
|
||
### Library Updates | ||
|
||
- TODO | ||
|
||
### Other News | ||
|
||
- TODO | ||
|
||
### Discussions | ||
|
||
- TODO | ||
|
||
## Publishing Steps | ||
|
||
- [ ] Final review - by everyone | ||
- [ ] Publish - by @janhohenheim | ||
- [ ] Post on /r/rust, /r/rust_gamedev, /r/gamedev, URLO - by @janhohenheim | ||
- [ ] Pin thread on Twitter - by @AngelOnFira | ||
- [ ] Add comment links - by @AngelOnFira | ||
|
||
## How to Contribute | ||
|
||
If you want to help writing the newsletter: | ||
|
||
- **Read [CONTRIBUTING.md](https://github.com/rust-gamedev/rust-gamedev.github.io/blob/source/CONTRIBUTING.md?rgh-link-date=2023-09-12T16%3A17%3A34Z).** | ||
- Choose one or more of the "🆓 **free**" sections listed below, and leave a | ||
comment letting us know you want to work on them. | ||
- The links in brackets (like `[1](#), [2](#), [3](#)`) are suggestions of | ||
links to include in the section. Feel free to add more! | ||
- 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). | ||
- 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. | ||
- Extra sections not listed in the plan are welcomed - | ||
just leave a comment and open a PR! | ||
- Write a short overview in the newsletter's Markdown file, | ||
making sure to follow the style guidelines (see below). | ||
- Send a PR _to the `source` branch_ (example: [N15: A/B Street #336](https://github.com/rust-gamedev/rust-gamedev.github.io/pull/336)). | ||
- Mention this issue in your PR's description to link it all together. | ||
|
||
## Style Guidelines | ||
|
||
The full style guide is in [CONTRIBUTING.md](https://github.com/rust-gamedev/rust-gamedev.github.io/blob/source/CONTRIBUTING.md?rgh-link-date=2023-09-12T16%3A17%3A34Z), | ||
but here are the most important rules: | ||
|
||
- Write in third-person perspective. | ||
- Each line must be 80 characters or less, for ease of reviewing/diffing. | ||
- Only one image per section is allowed. | ||
- The maximum size is 300kb for static images and 2.5mb for GIFs. | ||
- The image should come before the text, and must have alt text for accessibility. | ||
- Prefer static images to GIFs, to keep the page load times down. | ||
- Each section should be under 1000 characters, and under 6 paragraphs. | ||
- This only applies to the rendered text, not the markup. | ||
- Keep formatting minimal - no bold/italics/etc. | ||
- Avoid long/nested bullet point lists - no changelogs! | ||
|
||
Please use these templates as a starting point: | ||
|
||
**Games/apps/libraries:** | ||
|
||
```md | ||
### [Game name] | ||
|
||
 | ||
_optional image label_ | ||
|
||
[Game name] ([GitHub], [Discord], [Twitter]) by [@nickname] | ||
is... {short project description in one sentence}. | ||
|
||
{An overview of the recent updates with links to more details}. | ||
|
||
_Discussions: [/r/rust_gamedev](link), [Twitter](link), [etc](link)_ | ||
|
||
[Game name]: http://example.com | ||
``` | ||
|
||
**Articles/blog posts/videos/etc:** | ||
|
||
```md | ||
### [Article name] | ||
|
||
 | ||
_optional image label_ | ||
|
||
[@nickname] published an [article] about... | ||
{overview what the resource is about}. | ||
|
||
_Discussions: [/r/rust_gamedev](link), [Twiter](link), [etc](link)_ | ||
|
||
[Article name]: http://example.com | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Create Newsletter | ||
on: | ||
janhohenheim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
schedule: | ||
# Run on the 5th of every month at 12pm | ||
- cron: "0 12 5 * *" | ||
workflow_dispatch: | ||
inputs: {} | ||
permissions: | ||
contents: write | ||
issues: write | ||
jobs: | ||
create-newsletter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: source | ||
janhohenheim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Set environment variables | ||
run: | | ||
echo "NEWSLETTER_MONTH=$(date +'%B')" >> $GITHUB_ENV | ||
echo "NEWSLETTER_YEAR=$(date +'%Y')" >> $GITHUB_ENV | ||
echo "NEWSLETTER_DEADLINE=$(date -d' 1 month ' '+%m.%Y')" >> $GITHUB_ENV | ||
# take the amount of months since feb 2024 and add 50 | ||
echo "NEWSLETTER_COUNTER=$(( ( ( $(date +'%Y') - 2024 ) * 12 + $(date +'%m') - 2 ) + 50 ))" >> $GITHUB_ENV | ||
- name: Create newsletter scaffold | ||
run: ./.github/create_newsletter_scaffold.sh | ||
- name: Commit and push changes | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
message: "Create newsletter N${{ env.NEWSLETTER_COUNTER }} for ${{ env.NEWSLETTER_MONTH }} ${{ env.NEWSLETTER_YEAR }}" | ||
push: "origin HEAD:source" | ||
- name: Create tracking issue | ||
uses: JasonEtco/create-an-issue@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
filename: .github/newsletter-issue-template.md | ||
|
janhohenheim marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
+++ | ||
title = "This Month in Rust GameDev #{TODO} - {TODO} {TODO}" | ||
title = "This Month in Rust GameDev #{{ NEWSLETTER_COUNTER }} - {{ NEWSLETTER_MONTH }} {{ NEWSLETTER_YEAR }}" | ||
transparent = true | ||
date = TODO | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be templated too? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I left this blank because it's supposed to be the date the post is actually published. I could fill in the deadline if you want (3rd of the next month). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There you go: |
||
draft = true | ||
|
@@ -9,7 +9,7 @@ draft = true | |
|
||
<!-- Check the post with markdownlint--> | ||
|
||
Welcome to the {TODO}th issue of the Rust GameDev Workgroup's | ||
Welcome to the {{ NEWSLETTER_COUNTER }}th issue of the Rust GameDev Workgroup's | ||
monthly newsletter. | ||
[Rust] is a systems language pursuing the trifecta: | ||
safety, concurrency, and speed. | ||
|
Uh oh!
There was an error while loading. Please reload this page.