Skip to content

Commit bc771c4

Browse files
authored
Initial commit
0 parents  commit bc771c4

File tree

8 files changed

+425
-0
lines changed

8 files changed

+425
-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: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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@v5
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+
name: archive
45+
path: archive.json

.github/workflows/ghpages.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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@v5
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+
name: drafts
59+
path: |
60+
draft-*.html
61+
draft-*.txt

.github/workflows/publish.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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@v5
21+
with:
22+
# Needed for tracing file history for replacement status
23+
fetch-depth: 0
24+
fetch-tags: true
25+
26+
# See https://github.com/actions/checkout/issues/290
27+
- name: "Get Tag Annotations"
28+
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }}
29+
30+
- name: "Setup"
31+
id: setup
32+
run: date -u "+date=%FT%T" >>"$GITHUB_OUTPUT"
33+
34+
- name: "Caching"
35+
uses: actions/cache@v4
36+
with:
37+
path: |
38+
.refcache
39+
.venv
40+
.gems
41+
node_modules
42+
.targets.mk
43+
key: i-d-${{ steps.setup.outputs.date }}
44+
restore-keys: i-d-
45+
46+
- name: "Build Drafts"
47+
uses: martinthomson/i-d-template@v1
48+
with:
49+
token: ${{ github.token }}
50+
51+
- name: "Upload to Datatracker"
52+
uses: martinthomson/i-d-template@v1
53+
with:
54+
make: upload
55+
env:
56+
UPLOAD_EMAIL: ${{ inputs.email }}
57+
58+
- name: "Archive Submitted Drafts"
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: published
62+
path: "versioned/draft-*-[0-9][0-9].*"

.github/workflows/setup.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
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@v5
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: "Fix Lint"
99+
uses: martinthomson/i-d-template@v1
100+
with:
101+
make: fix-lint
102+
103+
- name: "Update Venue Information"
104+
uses: martinthomson/i-d-template@v1
105+
with:
106+
make: update-venue
107+
108+
- name: "Update GitHub Pages"
109+
uses: martinthomson/i-d-template@v1
110+
with:
111+
make: gh-pages
112+
113+
- name: "Push Changes"
114+
run: |
115+
git push

.github/workflows/update.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
permissions:
26+
contents: write
27+
steps:
28+
- name: "Checkout"
29+
uses: actions/checkout@v5
30+
31+
- name: "Update Generated Files"
32+
uses: martinthomson/i-d-template@v1
33+
with:
34+
make: update-files
35+
token: ${{ github.token }}
36+
37+
- name: "Push Update"
38+
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)