Skip to content

Commit

Permalink
Order files (#10)
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez committed Sep 3, 2024
1 parent 4578693 commit ab8939b
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 17 deletions.
8 changes: 4 additions & 4 deletions Justfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
set quiet

default: venv
venv/bin/python3 update-readme.py
venv/bin/python3 update-calendar.py
venv/bin/python3 update-badges.py
venv/bin/python3 scripts/update-readme.py
venv/bin/python3 scripts/update-calendar.py
venv/bin/python3 scripts/update-badges.py

venv:
#!/bin/bash
Expand All @@ -12,5 +12,5 @@ venv:
if [ ! -d "venv" ]; then
# Create virtual environment
python3 -m venv venv
venv/bin/pip install -r requirements.txt
venv/bin/pip install -r scripts/requirements.txt
fi
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Single source of truth regarding past and future releases of the Polkadot SDK.

This repo contains a [JSON schema](./releases-v1.schema.json) as schema for the [releases.json](./releases-v1.json) file that tracks all SDK releases.
This repo contains a [releases-v1.json](./releases-v1.json) file that tracks all SDK releases and a [JSON schema](./releases-v1.schema.json) to ensure that it is in canonical format.

## Calendar

Expand Down Expand Up @@ -74,7 +74,7 @@ The two main goals of this repo are to improve:
First, check the calendar when about 3 months passed from the publish date of the last release. Then subtract about 1.5 months from that and call the plan command with that date:

```bash
python3 manage.py release plan stable2412 2024-11-06
python3 scripts/manage.py release plan stable2412 2024-11-06
```

Then figure out when the first patch date should be; you have to select a Monday for the patching schedule to be calculated (errors if not a Monday). You should select either a week that is empty and has no schedule, or the one where the oldest release is currently being patched.
Expand All @@ -83,7 +83,7 @@ The script will then count the how many-th monday of the month it is and begin l
Example where we want the first patch to be cut off on 24024-07-29:

```bash
python3 manage.py backfill-patches stable2407 --start-date 2024-07-29
python3 scripts/manage.py backfill-patches stable2407 --start-date 2024-07-29
```

Then update the README to see the changes by running `just`.
Expand All @@ -93,7 +93,7 @@ Then update the README to see the changes by running `just`.
Run this command to cut off a release:

```bash
python3 manage.py release cutoff stable2407-2 2024-09-02
python3 scripts/manage.py release cutoff stable2407-2 2024-09-02
```

With `publish` likewise.
Expand All @@ -102,10 +102,10 @@ With `publish` likewise.

Two scripts are currently in place to:

- [manage.py](./manage.py) - manage the releases json file (plan, cutoff, publish, etc)
- [update-readme.py](./update-readme.py) - updates the README.md file with the data from the releases.json file
- [update-calendar.py](./update-calendar.py) - generates an iCal file from the releases.json file
- [update-badges.py](./update-badges.py) - re-generate the badges in the `badges` folder for downstream use.
- [manage.py](./scripts/manage.py) - manage the releases json file (plan, cutoff, publish, etc)
- [update-readme.py](./scripts/update-readme.py) - updates the README.md file with the data from the releases.json file
- [update-calendar.py](./scripts/update-calendar.py) - generates an iCal file from the releases.json file
- [update-badges.py](./scripts/update-badges.py) - re-generate the badges in the `badges` folder for downstream use.

## Roadmap

Expand Down
File renamed without changes.
File renamed without changes.
13 changes: 11 additions & 2 deletions update-badges.py → scripts/update-badges.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
"""
This script updates the SVG files in the badges folder.
Just run it in its stock configuration from the root folder:
python scripts/update-badges.py
"""

import json
import os
import requests
Expand All @@ -7,11 +16,11 @@

def download(url, filename):
response = requests.get(url)
print(f"Downloading SVG from {url}")


if response.status_code == 200:
with open(filename, 'wb') as file:
file.write(response.content)
print(f"Downloaded {filename}")
else:
raise Exception(f"Failed to download SVG. Status code: {response.status_code}")

Expand Down
8 changes: 8 additions & 0 deletions update-calendar.py → scripts/update-calendar.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
"""
Updates the iCal calendar file in the root directory. Just run it in the top level dir in its stock
configuration:
python scripts/update-calendar.py
"""

import json
from datetime import datetime, timedelta
from icalendar import Calendar, Event
Expand Down
5 changes: 2 additions & 3 deletions update-readme.py → scripts/update-readme.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"""
Update the README.md from the root directory:
Update the README.md with:
python3 update-readme.py
python3 scripts/update-readme.py
"""

Expand Down

0 comments on commit ab8939b

Please sign in to comment.