diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 65d49fa..964dd41 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -15,7 +15,7 @@ > a link to it. Either: > > None -> https://github.com/netmod-wg/yang2/designs/\ +> https://github.com/netmod-wg/yang2/designs/ ## Additional Information diff --git a/.github/workflows/gen_author_list.sh b/.github/workflows/gen_author_list.sh index 8aad0f2..d2cd8fc 100755 --- a/.github/workflows/gen_author_list.sh +++ b/.github/workflows/gen_author_list.sh @@ -46,7 +46,11 @@ sorted_xml_authors() { # output authors as an XML 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}'` @@ -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" + diff --git a/.github/workflows/gen_index_html.sh b/.github/workflows/gen_index_html.sh index ba15f5c..b69cf5a 100644 --- a/.github/workflows/gen_index_html.sh +++ b/.github/workflows/gen_index_html.sh @@ -32,7 +32,6 @@ echo "" >> index.html echo " " >> index.html echo " " >> index.html echo " " >> index.html -echo " " >> index.html echo " " >> index.html echo " " >> index.html echo " " >> index.html @@ -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$DATE" >> index.html + # the "Pull Request" column if [ $branch = "main" ]; then - echo " " >> index.html + echo " " >> index.html else echo " " >> index.html fi - if [ $branch = "main" ]; then - echo " " >> index.html - else - echo " " >> 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 " " >> index.html + # the "Formats" column + echo " " >> index.html + # the "Actions" column if [ $branch = "main" ]; then - echo " " >> index.html + echo " " >> index.html else - echo " " >> index.html + echo " " >> index.html fi echo " " >> index.html done diff --git a/.github/workflows/pull_request_closed.yml b/.github/workflows/pull_request_closed.yml index fd83a04..19dc54e 100644 --- a/.github/workflows/pull_request_closed.yml +++ b/.github/workflows/pull_request_closed.yml @@ -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: | @@ -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 @@ -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 + diff --git a/.github/workflows/pull_request_updated.yml b/.github/workflows/pull_request_updated.yml index 52dc1af..00725a0 100644 --- a/.github/workflows/pull_request_updated.yml +++ b/.github/workflows/pull_request_updated.yml @@ -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" @@ -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 @@ -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: @@ -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." @@ -175,9 +182,11 @@ jobs: } rm drafts.tgz - # create the "mysite//" directory, in case it's not there already + # create the "mysite//" directory (delete old if present) - name: Create the mysite// 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 @@ -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 @@ -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 diff --git a/.github/workflows/update_page.py b/.github/workflows/update_page.py deleted file mode 100644 index 407c3c4..0000000 --- a/.github/workflows/update_page.py +++ /dev/null @@ -1,8 +0,0 @@ -import sys - -def main(): - print ("Inside Python script...") - sys.exit(0) - -if __name__ == '__main__': - main() diff --git a/Makefile b/Makefile index f76f7ff..5f86444 100644 --- a/Makefile +++ b/Makefile @@ -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 - diff --git a/draft-yn-netmod-yang2.xml b/draft-yn-netmod-yang2.xml index a888644..a21b661 100644 --- a/draft-yn-netmod-yang2.xml +++ b/draft-yn-netmod-yang2.xml @@ -53,6 +53,8 @@ This document is developed on GitHub at ). If you wish to contribute, please consider opening a pull request (PR). See the README file for details. + See + for a dashboard of the document's status.
UpdatedPull RequestMerge OperationFormatsActions
N/A, since this is the \"main\" branch (last updated by #$NUMBER: $TITLE).N/A, since this is the \"main\" branch#$NUMBER: $TITLEN/A, since this is the \"main\" branch.Branch \"$branch\" merges into branch \"$BASE\".
html / text / xml
html / text / xml
Diff with RFC7950
Diff with Datatracker
Diff with RFC7950
Diff with Datatracker
Diff with Main Diff with Main