Skip to content

Commit 302d4ae

Browse files
committed
Add I-D template
1 parent 1ed6a38 commit 302d4ae

File tree

8 files changed

+285
-8
lines changed

8 files changed

+285
-8
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: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
steps:
20+
- name: "Checkout"
21+
uses: actions/checkout@v2
22+
23+
# Note: No caching for this build!
24+
25+
- name: "Update Archive"
26+
uses: martinthomson/i-d-template@v1
27+
env:
28+
ARCHIVE_FULL: ${{ inputs.archive_full }}
29+
with:
30+
make: archive
31+
token: ${{ github.token }}
32+
33+
- name: "Update GitHub Pages"
34+
uses: martinthomson/i-d-template@v1
35+
with:
36+
make: gh-archive
37+
token: ${{ github.token }}
38+
39+
- name: "Save Archive"
40+
uses: actions/upload-artifact@v3
41+
with:
42+
path: archive.json

.github/workflows/ghpages.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
steps:
22+
- name: "Checkout"
23+
uses: actions/checkout@v3
24+
25+
- name: "Setup"
26+
id: setup
27+
run: date -u "+date=%FT%T" >>"$GITHUB_OUTPUT"
28+
29+
- name: "Caching"
30+
uses: actions/cache@v3
31+
with:
32+
path: |
33+
.refcache
34+
.venv
35+
.gems
36+
node_modules
37+
.targets.mk
38+
key: i-d-${{ steps.setup.outputs.date }}
39+
restore-keys: i-d-
40+
41+
- name: "Build Drafts"
42+
uses: martinthomson/i-d-template@v1
43+
with:
44+
token: ${{ github.token }}
45+
46+
- name: "Update GitHub Pages"
47+
uses: martinthomson/i-d-template@v1
48+
if: ${{ github.event_name == 'push' }}
49+
with:
50+
make: gh-pages
51+
token: ${{ github.token }}
52+
53+
- name: "Archive Built Drafts"
54+
uses: actions/upload-artifact@v3
55+
with:
56+
path: |
57+
draft-*.html
58+
draft-*.txt

.github/workflows/publish.yml

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

.github/workflows/setup.yml

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

make.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)