Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
> a link to it. Either:
>
> None
> https://github.com/netmod-wg/yang2/designs/\<filename\>
> https://github.com/netmod-wg/yang2/designs/<filename>


## Additional Information
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/gen_author_list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ sorted_xml_authors() {
# output authors as an XML <author> element
for a in $AUTHORS; do

FULL_NAME=`grep $a $0 | awk -F'"' '{print $2}'`
# skip bot
echo $a | grep -q kent && continue # skip bot

# collect info from "AUTHOR INFO" at bottom
FULL_NAME=`grep $a $0 | awk -F'"' '{print $2}' || echo "$a NOT FOUND"`
ORGANIZATION=`grep $a $0 | awk -F'"' '{print $4}'`
FIRST_NAME=`echo $FULL_NAME | awk '{print $1}'`
LAST_NAME=`echo $FULL_NAME | awk '{print $2}'`
Expand All @@ -70,11 +74,12 @@ main() {
exit 1
fi
echo "$SORTED_XML" > .authors.txt
cat .authors.txt
}


main "$@"


#### AUTHOR INFO ####
#### AUTHOR INFO (used by *this* script) ####
#kwatsen: "Kent Watsen" "Watsen Networks" "kent+ietf@watsen.net"

26 changes: 14 additions & 12 deletions .github/workflows/gen_index_html.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ echo "<table class=\"bg\">" >> index.html
echo " <tr class=\"bg\">" >> index.html
echo " <th class=\"bg\"><b>Updated</b></th>" >> index.html
echo " <th class=\"bg\"><b>Pull Request</b></th>" >> index.html
echo " <th class=\"bg\"><b>Merge Operation</b></th>" >> index.html
echo " <th class=\"bg\"><b>Formats</b></th>" >> index.html
echo " <th class=\"bg\"><b>Actions</b></th>" >> index.html
echo " </tr>" >> index.html
Expand All @@ -41,28 +40,31 @@ for branch in $SORTED; do
NUMBER=`grep NUMBER $branch/metadata.txt | awk '{print $2}'`
TITLE=`grep TITLE $branch/metadata.txt | awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}'`
DATE=`grep DATE $branch/metadata.txt | awk '{print $2}'`
grep -q BASE $branch/metadata.txt || BASE="main" # delete this after PR #36 merges...
grep -q BASE $branch/metadata.txt && BASE=`grep BASE $branch/metadata.txt | awk '{print $2}'`

# the "Updated" column
echo " <td class=\"bg\" nowrap>$DATE</td>" >> index.html

# the "Pull Request" column
if [ $branch = "main" ]; then
echo " <td class=\"bg\">N/A, since this is the \"main\" branch (last updated by <a href=\"https://github.com/netmod-wg/yang2/pull/$NUMBER\">#$NUMBER: $TITLE</a>).</td>" >> index.html
echo " <td class=\"bg\">N/A, since this is the \"main\" branch</td>" >> index.html
else
echo " <td class=\"bg\"><a href=\"https://github.com/netmod-wg/yang2/pull/$NUMBER\">#$NUMBER: $TITLE</a></td>" >> index.html
fi

if [ $branch = "main" ]; then
echo " <td class=\"bg\">N/A, since this is the <a href=\"https://github.com/netmod-wg/yang2/tree/main\">\"main\"</a> branch.</td>" >> index.html
else
echo " <td class=\"bg\">Branch <a href=\"https://github.com/netmod-wg/yang2/tree/$branch\">\"$branch\"</a> merges into branch <a href=\"https://github.com/netmod-wg/yang2/tree/$BASE\">\"$BASE\"</a>.</td>" >> index.html
fi
# get main's draft version number (delete the trailing '|| echo "00"' once merged into main)
MVER=`ls -1 main/draft-yn-netmod-yang2-[0-9][0-9].xml | sed -e 's/.*-//' -e 's/\.xml$//' || echo "00"`

# get branch's draft version number (yes, branch may be "main" too)
BVER=`ls -1 $branch/draft-yn-netmod-yang2-[0-9][0-9].xml | sed -e 's/.*-//' -e 's/\.xml$//'`

echo " <td nowrap class=\"bg\"> <table> <tr> <td nowrap><a href=\"$branch/draft-yn-netmod-yang2-00.html\">html</a> / <a href=\"$branch/draft-yn-netmod-yang2-00.txt\">text</a> / <a href=\"$branch/draft-yn-netmod-yang2-00.xml\">xml</a></td> </tr> </table> </td>" >> index.html
# the "Formats" column
echo " <td nowrap class=\"bg\"> <table> <tr> <td nowrap><a href=\"$branch/draft-yn-netmod-yang2-$BVER.html\">html</a> / <a href=\"$branch/draft-yn-netmod-yang2-$BVER.txt\">text</a> / <a href=\"$branch/draft-yn-netmod-yang2-$BVER.xml\">xml</a></td> </tr> </table> </td>" >> index.html

# the "Actions" column
if [ $branch = "main" ]; then
echo " <td nowrap class=\"bg\"><a href=\"https://author-tools.ietf.org/iddiff?url_1=https://netmod-wg.github.io/yang2/main/rfc7950.txt&url_2=https://netmod-wg.github.io/yang2/main/draft-yn-netmod-yang2-00.txt\">Diff with RFC7950</a><br><a href=\"https://author-tools.ietf.org/api/iddiff?doc_1=draft-yn-netmod-yang2&url_2=https://netmod-wg.github.io/yang2/main/draft-yn-netmod-yang2-00.txt.paged.txt\">Diff with Datatracker</a> </td>" >> index.html
echo " <td nowrap class=\"bg\"><a href=\"https://author-tools.ietf.org/iddiff?url_1=https://netmod-wg.github.io/yang2/main/rfc7950.txt&url_2=https://netmod-wg.github.io/yang2/main/draft-yn-netmod-yang2-$MVER.txt\">Diff with RFC7950</a><br><a href=\"https://author-tools.ietf.org/api/iddiff?doc_1=draft-yn-netmod-yang2&url_2=https://netmod-wg.github.io/yang2/main/draft-yn-netmod-yang2-$MVER.txt.paged.txt\">Diff with Datatracker</a> </td>" >> index.html
else
echo " <td nowrap class=\"bg\"> <a href=\"https://author-tools.ietf.org/api/iddiff?url_1=https://netmod-wg.github.io/yang2/$BASE/draft-yn-netmod-yang2-00.txt&url_2=https://netmod-wg.github.io/yang2/$branch/draft-yn-netmod-yang2-00.txt\">Diff with Main</a> </td>" >> index.html
echo " <td nowrap class=\"bg\"> <a href=\"https://author-tools.ietf.org/api/iddiff?url_1=https://netmod-wg.github.io/yang2/main/draft-yn-netmod-yang2-$MVER.txt&url_2=https://netmod-wg.github.io/yang2/$branch/draft-yn-netmod-yang2-$BVER.txt\">Diff with Main</a> </td>" >> index.html
fi
echo " </tr>" >> index.html
done
Expand Down
29 changes: 26 additions & 3 deletions .github/workflows/pull_request_closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ jobs:
tar -xzvf drafts.tgz
rm drafts.tgz

# if merged...
# if merged... (i.e., PR succeeded)
- name: If merged, move compiled artifacts to 'main'
if: github.event.pull_request.merged == true
run: |
rm -rf mysite/main
mv mysite/${{github.head_ref}} mysite/main

# if not merged...
# if not merged... (i.e., PR failed)
- name: If not merged, just delete the branch dir
if: github.event.pull_request.merged == false
run: |
Expand All @@ -50,7 +50,7 @@ jobs:
- name: Create mysite/index.html
run: |
chmod +x .github/workflows/gen_index_html.sh
.github/workflows/gen_index_html.sh "${{github.event.pull_request.number}}" "${{github.event.pull_request.title}}" "${{github.event.pull_request.head.ref}}"
.github/workflows/gen_index_html.sh

# recreate the drafts.tgz
- name: Recreate drafts.tgz
Expand All @@ -68,3 +68,26 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

increment_git_tag:
name: Increment Git Tag
runs-on: macos-latest
needs: update_github_pages
if: github.event.pull_request.merged == true
steps:

# checkout repo so can run `git tag`
- uses: actions/checkout@v4
- name: Push the tag
run: |
curl -O https://netmod-wg.github.io/yang2/drafts.tgz
tar -xzvf drafts.tgz
rm drafts.tgz
tree
ls main/
ls -1 main/draft-yn-netmod-yang2-[0-9][0-9].xml
TAG=`ls -1 main/draft-yn-netmod-yang2-[0-9][0-9].xml | sed -e 's/\.xml$//'`
echo "TAG=$TAG"
git tag $TAG
git push --tags

24 changes: 16 additions & 8 deletions .github/workflows/pull_request_updated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ jobs:
- name: checklist
env:
COMMENT: |
# All of the following must be verified before merging to `main`.
# All of the following MUST be verified by AUTHORS before merging to `main`:
- [ ] Updated "Changes Since RFC 7950" section, or N/A?
- [ ] Updated "IANA Considerations" section, or N/A?
- [ ] Updated "Security Considerations" section, or N/A?
- [ ] Updated "Normative/Informational References" sections, or N/A?
- [ ] Updated "Acknowledgements" section, or N/A? (Not GitHub users)

# The following MUST be verified by the EDITOR before merging to `main`:
- [ ] The XML artifact uploads to Datatracker?

GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr comment https://github.com/netmod-wg/yang2/pull/${{github.event.number}} --body "$COMMENT"

Expand All @@ -29,6 +33,8 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
fetch-tags: true
- name: generate authors.txt
run: |
chmod +x .github/workflows/gen_author_list.sh
Expand All @@ -39,7 +45,8 @@ jobs:
wget https://raw.githubusercontent.com/ietf-tools/rfcfold/master/rfcfold
chmod +x rfcfold
- name: Run "make"
run: make
run: |
make
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -135,7 +142,7 @@ jobs:
with:
issue-number: ${{github.event.number}}
comment-author: 'github-actions[bot]'
body-includes: 'All of the following must be verified before merging to `main`.'
body-includes: 'All of the following MUST be verified by AUTHORS before merging to `main`:'
- run: |
if ${{ contains(steps.fc.outputs.comment-body, '[ ] Updated') }} ; then
echo "All checklist items must be selected."
Expand Down Expand Up @@ -175,9 +182,11 @@ jobs:
}
rm drafts.tgz

# create the "mysite/<branch>/" directory, in case it's not there already
# create the "mysite/<branch>/" directory (delete old if present)
- name: Create the mysite/<branch>/ directory
run: mkdir -p mysite/${{github.head_ref}}
run: |
rm -rf mysite/${{github.head_ref}}
mkdir mysite/${{github.head_ref}}

# download the just-built artifacts
- name: Download built artifacts
Expand All @@ -192,9 +201,8 @@ jobs:
mv rfc7950.* mysite/${{github.head_ref}}/

# stash some metadata
- name: Stash some metadata
- name: Stash some metadata (for gen_index_html.sh)
run: |
echo "${{github.event.pull_request}}"
echo "NUMBER: ${{github.event.pull_request.number}}" > mysite/${{github.head_ref}}/metadata.txt
echo "TITLE: ${{github.event.pull_request.title}}" >> mysite/${{github.head_ref}}/metadata.txt
echo "DATE: $(date +%Y-%m-%dT%H:%M:%SZ)" >> mysite/${{github.head_ref}}/metadata.txt
Expand All @@ -209,7 +217,7 @@ jobs:
- name: Create mysite/index.html
run: |
chmod +x .github/workflows/gen_index_html.sh
.github/workflows/gen_index_html.sh "${{github.event.pull_request.number}}" "${{github.event.pull_request.title}}" "${{github.event.pull_request.head.ref}}"
.github/workflows/gen_index_html.sh

# recreate the drafts.tgz
- name: Recreate drafts.tgz
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/update_page.py

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ clean:
clean_draft:
-rm -f $(draft)-[0-9][0-9].xml
-rm -f $(draft)-[0-9][0-9].txt
-rm -f $(draft)-[0-9][0-9].txt.paged.txt
-rm -f $(draft)-[0-9][0-9].html

2 changes: 2 additions & 0 deletions draft-yn-netmod-yang2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
<t>This document is developed on GitHub at <eref target="https://github.com/netmod-wg/yang2"/>).
If you wish to contribute, please consider opening a pull request (PR).
See the README file for details.</t>
<t>See <eref target="https://netmod-wg.github.io/yang2"/>
for a dashboard of the document's status.</t>
</note>
</front>
<middle>
Expand Down
Loading