Skip to content

Commit 9c45b84

Browse files
authored
Initial commit
0 parents  commit 9c45b84

File tree

8 files changed

+410
-0
lines changed

8 files changed

+410
-0
lines changed

.github/workflows/LICENSE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This project is in the public domain.

.github/workflows/archive.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: "Archive Issues and Pull Requests"
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 0,2,4'
6+
repository_dispatch:
7+
types: [archive]
8+
workflow_dispatch:
9+
inputs:
10+
archive_full:
11+
description: 'Recreate the archive from scratch'
12+
default: false
13+
type: boolean
14+
15+
jobs:
16+
build:
17+
name: "Archive Issues and Pull Requests"
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
steps:
22+
- name: "Checkout"
23+
uses: actions/checkout@v4
24+
25+
# Note: No caching for this build!
26+
27+
- name: "Update Archive"
28+
uses: martinthomson/i-d-template@v1
29+
env:
30+
ARCHIVE_FULL: ${{ inputs.archive_full }}
31+
with:
32+
make: archive
33+
token: ${{ github.token }}
34+
35+
- name: "Update GitHub Pages"
36+
uses: martinthomson/i-d-template@v1
37+
with:
38+
make: gh-archive
39+
token: ${{ github.token }}
40+
41+
- name: "Save Archive"
42+
uses: actions/upload-artifact@v4
43+
with:
44+
path: archive.json

.github/workflows/ghpages.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: "Update Editor's Copy"
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- README.md
7+
- CONTRIBUTING.md
8+
- LICENSE.md
9+
- .gitignore
10+
pull_request:
11+
paths-ignore:
12+
- README.md
13+
- CONTRIBUTING.md
14+
- LICENSE.md
15+
- .gitignore
16+
17+
jobs:
18+
build:
19+
name: "Update Editor's Copy"
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: write
23+
steps:
24+
- name: "Checkout"
25+
uses: actions/checkout@v4
26+
27+
- name: "Setup"
28+
id: setup
29+
run: date -u "+date=%FT%T" >>"$GITHUB_OUTPUT"
30+
31+
- name: "Caching"
32+
uses: actions/cache@v4
33+
with:
34+
path: |
35+
.refcache
36+
.venv
37+
.gems
38+
node_modules
39+
.targets.mk
40+
key: i-d-${{ steps.setup.outputs.date }}
41+
restore-keys: i-d-
42+
43+
- name: "Build Drafts"
44+
uses: martinthomson/i-d-template@v1
45+
with:
46+
token: ${{ github.token }}
47+
48+
- name: "Update GitHub Pages"
49+
uses: martinthomson/i-d-template@v1
50+
if: ${{ github.event_name == 'push' }}
51+
with:
52+
make: gh-pages
53+
token: ${{ github.token }}
54+
55+
- name: "Archive Built Drafts"
56+
uses: actions/upload-artifact@v4
57+
with:
58+
path: |
59+
draft-*.html
60+
draft-*.txt

.github/workflows/publish.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: "Publish New Draft Version"
2+
3+
on:
4+
push:
5+
tags:
6+
- "draft-*"
7+
workflow_dispatch:
8+
inputs:
9+
email:
10+
description: "Submitter email"
11+
default: ""
12+
type: string
13+
14+
jobs:
15+
build:
16+
name: "Publish New Draft Version"
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: "Checkout"
20+
uses: actions/checkout@v4
21+
22+
# See https://github.com/actions/checkout/issues/290
23+
- name: "Get Tag Annotations"
24+
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }}
25+
26+
- name: "Setup"
27+
id: setup
28+
run: date -u "+date=%FT%T" >>"$GITHUB_OUTPUT"
29+
30+
- name: "Caching"
31+
uses: actions/cache@v4
32+
with:
33+
path: |
34+
.refcache
35+
.venv
36+
.gems
37+
node_modules
38+
.targets.mk
39+
key: i-d-${{ steps.setup.outputs.date }}
40+
restore-keys: i-d-
41+
42+
- name: "Build Drafts"
43+
uses: martinthomson/i-d-template@v1
44+
with:
45+
token: ${{ github.token }}
46+
47+
- name: "Upload to Datatracker"
48+
uses: martinthomson/i-d-template@v1
49+
with:
50+
make: upload
51+
env:
52+
UPLOAD_EMAIL: ${{ inputs.email }}
53+
54+
- name: "Archive Submitted Drafts"
55+
uses: actions/upload-artifact@v4
56+
with:
57+
path: "versioned/draft-*-[0-9][0-9].*"

.github/workflows/setup.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: "Perform Initial Repository Setup"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
pre:
9+
name: "Setup Repository"
10+
runs-on: ubuntu-latest
11+
outputs:
12+
skip: ${{ steps.pre.outputs.skip }}
13+
steps:
14+
- name: "Checkout"
15+
uses: actions/checkout@v4
16+
17+
- name: "Precondition Check"
18+
id: pre
19+
run: |
20+
if ! ls draft-* rfc* 2>/dev/null | grep -qv draft-todo-yourname-protocol.md; then
21+
{
22+
echo "------------------------------------------------------------"
23+
echo "Skipping setup for the first commit."
24+
echo
25+
echo "Rename draft-todo-yourname-protocol.md to start using this repository:"
26+
echo
27+
echo "> https://github.com/${{github.repository}}/edit/main/draft-todo-yourname-protocol.md"
28+
echo
29+
echo "Change the name of the file and its title."
30+
echo "Commit the changes to the 'main' branch."
31+
echo
32+
echo "------------------------------------------------------------"
33+
} >>"$GITHUB_STEP_SUMMARY"
34+
echo "skip=true" >>"$GITHUB_OUTPUT"
35+
elif [ ! -f draft-todo-yourname-protocol.md -a -f Makefile ]; then
36+
{
37+
echo "------------------------------------------------------------"
38+
echo "Skipping setup for an already-configured repository."
39+
echo
40+
echo "Delete .github/workflows/setup.yml to avoid running this action:"
41+
echo
42+
echo "> https://github.com/${{github.repository}}/delete/main/.github/workflows/setup.yml"
43+
echo
44+
echo "------------------------------------------------------------"
45+
} >>"$GITHUB_STEP_SUMMARY"
46+
echo "skip=true" >>"$GITHUB_OUTPUT"
47+
else
48+
echo "skip=false" >>"$GITHUB_OUTPUT"
49+
fi
50+
51+
setup:
52+
name: "Setup Repository"
53+
runs-on: ubuntu-latest
54+
needs: pre
55+
if: ${{ needs.pre.outputs.skip != 'true' }}
56+
permissions:
57+
contents: write
58+
steps:
59+
- name: "Checkout"
60+
uses: actions/checkout@v4
61+
62+
- name: "Git Config"
63+
run: |
64+
git config user.email "[email protected]"
65+
git config user.name "I-D Bot"
66+
67+
- name: "Update Draft Name"
68+
run: |
69+
for i in draft-*; do
70+
if [ "$(head -1 "$i")" = "---" ]; then
71+
sed -i -e '2,/^---/{/^###/,/^###/d
72+
s|^docname: .*|docname: '"${i%.md}-latest"'|
73+
s|^ fullname: Your Name Here| fullname: "'"$(git show -q --format='format:%aN' @)"'"|
74+
s|^ email: your\.email@example\.com| email: "'"$(git show -q --format='format:%aE' @)"'"|
75+
}' "$i"
76+
fi
77+
sed -i -e "s/draft-todo-yourname-protocol-latest/${i%.md}-latest/g" "$i"
78+
git add "$i"
79+
done
80+
if [ -n "$(git status --porcelain draft-*)" ]; then
81+
git commit -m "Update draft labels" draft-*
82+
fi
83+
84+
- name: "Cleanup"
85+
run: |
86+
git rm -rf .github/workflows/setup.yml README.md
87+
git commit -m "Remove setup files"
88+
89+
- name: "Clone the i-d-template Repo"
90+
run: |
91+
git clone --depth=1 https://github.com/martinthomson/i-d-template lib
92+
93+
- name: "Run i-d-template Setup"
94+
uses: martinthomson/i-d-template@v1
95+
with:
96+
make: setup
97+
98+
- name: "Update Venue Information"
99+
uses: martinthomson/i-d-template@v1
100+
with:
101+
make: update-venue
102+
103+
- name: "Update GitHub Pages"
104+
uses: martinthomson/i-d-template@v1
105+
with:
106+
make: gh-pages
107+
108+
- name: "Push Changes"
109+
run: |
110+
git push

.github/workflows/update.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Update Generated Files"
2+
# This rule is not run automatically.
3+
# It can be run manually to update all of the files that are part
4+
# of the template, specifically:
5+
# - README.md
6+
# - CONTRIBUTING.md
7+
# - .note.xml
8+
# - .github/CODEOWNERS
9+
# - Makefile
10+
#
11+
#
12+
# This might be useful if you have:
13+
# - added, removed, or renamed drafts (including after adoption)
14+
# - added, removed, or changed draft editors
15+
# - changed the title of drafts
16+
#
17+
# Note that this removes any customizations you have made to
18+
# the affected files.
19+
on: workflow_dispatch
20+
21+
jobs:
22+
build:
23+
name: "Update Files"
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: "Checkout"
27+
uses: actions/checkout@v4
28+
29+
- name: "Update Generated Files"
30+
uses: martinthomson/i-d-template@v1
31+
with:
32+
make: update-files
33+
token: ${{ github.token }}
34+
35+
- name: "Push Update"
36+
run: git push

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Internet-Draft Template Repository
2+
3+
Use this repository as a template if you want to start working on
4+
[IETF](https://www.ietf.org/) documents. [Click here to create a new repository using the
5+
template](https://github.com/martinthomson/internet-draft-template/generate).
6+
Make sure to check "Include all branches", or you will need to enable GitHub Pages manually.
7+
8+
[Read the
9+
instructions](https://github.com/martinthomson/i-d-template/blob/main/doc/TEMPLATE.md)
10+
for more information.
11+
12+
Once you have created your own repository, start work by
13+
[renaming the `draft-todo-yourname-protocol.md` file](../../edit/main/draft-todo-yourname-protocol.md).

0 commit comments

Comments
 (0)