Skip to content

Commit

Permalink
Merge pull request #1368 from martinthomson/workflow-update
Browse files Browse the repository at this point in the history
Workflow update
  • Loading branch information
ekr authored Jan 20, 2025
2 parents ebe7722 + 5c061c6 commit 42bf01c
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 56 deletions.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Automatically generated CODEOWNERS
# Regenerate with `make update-codeowners`
draft-ietf-tls-rfc8446bis.md [email protected]
22 changes: 16 additions & 6 deletions .github/workflows/archive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,40 @@ on:
- cron: '0 0 * * 0,2,4'
repository_dispatch:
types: [archive]
workflow_dispatch:
inputs:
archive_full:
description: 'Recreate the archive from scratch'
default: false
type: boolean

jobs:
build:
name: "Archive Issues and Pull Requests"
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: "Checkout"
uses: actions/checkout@v2
uses: actions/checkout@v4

# Note: No caching for this build!

- name: "Update Archive"
uses: martinthomson/i-d-template@v1
env:
ARCHIVE_FULL: ${{ inputs.archive_full }}
with:
make: archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
token: ${{ github.token }}

- name: "Update GitHub Pages"
uses: martinthomson/i-d-template@v1
with:
make: gh-archive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
token: ${{ github.token }}

- name: "Save Archive"
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
path: archive.json
48 changes: 24 additions & 24 deletions .github/workflows/ghpages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,43 @@ jobs:
build:
name: "Update Editor's Copy"
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: "Checkout"
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: "Cache Setup"
id: cache-setup
run: |
mkdir -p "$HOME"/.cache/xml2rfc
echo "::set-output name=path::$HOME/.cache/xml2rfc"
date -u "+::set-output name=date::%FT%T"
- name: "Setup"
id: setup
run: date -u "+date=%FT%T" >>"$GITHUB_OUTPUT"

- name: "Cache References"
uses: actions/cache@v2
- name: "Caching"
uses: actions/cache@v4
with:
path: ${{ steps.cache-setup.outputs.path }}
key: refcache-${{ steps.cache-setup.outputs.date }}
restore-keys: |
refcache-${{ steps.cache-setup.outputs.date }}
refcache-
path: |
.refcache
.venv
.gems
node_modules
.targets.mk
key: i-d-${{ steps.setup.outputs.date }}
restore-keys: i-d-

- name: "Build Drafts"
uses: martinthomson/i-d-template@v1
with:
token: ${{ github.token }}

- name: "Update GitHub Pages"
uses: martinthomson/i-d-template@v1
if: ${{ github.event_name == 'push' }}
with:
make: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Save HTML"
uses: actions/upload-artifact@v2
with:
path: "*.html"
token: ${{ github.token }}

- name: "Save Text"
uses: actions/upload-artifact@v2
- name: "Archive Built Drafts"
uses: actions/upload-artifact@v4
with:
path: "*.txt"
path: |
draft-*.html
draft-*.txt
46 changes: 32 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,54 @@ on:
push:
tags:
- "draft-*"
workflow_dispatch:
inputs:
email:
description: "Submitter email"
default: ""
type: string

jobs:
build:
name: "Publish New Draft Version"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v2
uses: actions/checkout@v4

# See https://github.com/actions/checkout/issues/290
- name: "Get Tag Annotations"
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }}

- name: "Cache Setup"
id: cache-setup
run: |
mkdir -p "$HOME"/.cache/xml2rfc
echo "::set-output name=path::$HOME/.cache/xml2rfc"
date -u "+::set-output name=date::%FT%T"
- name: "Setup"
id: setup
run: date -u "+date=%FT%T" >>"$GITHUB_OUTPUT"

- name: "Cache References"
uses: actions/cache@v2
- name: "Caching"
uses: actions/cache@v4
with:
path: ${{ steps.cache-setup.outputs.path }}
key: refcache-${{ steps.date.outputs.date }}
restore-keys: |
refcache-${{ steps.date.outputs.date }}
refcache-
path: |
.refcache
.venv
.gems
node_modules
.targets.mk
key: i-d-${{ steps.setup.outputs.date }}
restore-keys: i-d-

- name: "Build Drafts"
uses: martinthomson/i-d-template@v1
with:
token: ${{ github.token }}

- name: "Upload to Datatracker"
uses: martinthomson/i-d-template@v1
with:
make: upload
env:
UPLOAD_EMAIL: ${{ inputs.email }}

- name: "Archive Submitted Drafts"
uses: actions/upload-artifact@v4
with:
path: "versioned/draft-*-[0-9][0-9].*"
36 changes: 36 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Update Generated Files"
# This rule is not run automatically.
# It can be run manually to update all of the files that are part
# of the template, specifically:
# - README.md
# - CONTRIBUTING.md
# - .note.xml
# - .github/CODEOWNERS
# - Makefile
#
#
# This might be useful if you have:
# - added, removed, or renamed drafts (including after adoption)
# - added, removed, or changed draft editors
# - changed the title of drafts
#
# Note that this removes any customizations you have made to
# the affected files.
on: workflow_dispatch

jobs:
build:
name: "Update Files"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4

- name: "Update Generated Files"
uses: martinthomson/i-d-template@v1
with:
make: update-files
token: ${{ github.token }}

- name: "Push Update"
run: git push
29 changes: 21 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
*.html
*.pdf
*.redxml
*.swp
*.txt
*.upload
*~
.refcache
.targets.mk
.tags
/*-[0-9][0-9].xml
/.*.mk
/.gems/
/.refcache
/.venv/
/.vscode/
/lib
/node_modules/
/package-lock.json
diff-*.html
draft-*.html
draft-*.txt
draft-*.xml
lib
/versioned/
Gemfile.lock
archive.json
draft-ietf-tls-rfc8446bis.xml
package-lock.json
report.xml
!requirements.txt
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
MD_PREPROCESSOR := python3 mk-appendix.py
XML_RESOURCE_ORG_PREFIX = https://xml2rfc.tools.ietf.org/public/rfc

include lib/main.mk
LIBDIR := lib
include $(LIBDIR)/main.mk

lib/main.mk:
ifneq (,$(shell git submodule status lib 2>/dev/null))
$(LIBDIR)/main.mk:
ifneq (,$(shell grep "path *= *$(LIBDIR)" .gitmodules 2>/dev/null))
git submodule sync
git submodule update --init
else
git clone --depth 10 -b main https://github.com/martinthomson/i-d-template.git lib
ifneq (,$(wildcard $(ID_TEMPLATE_HOME)))
ln -s "$(ID_TEMPLATE_HOME)" $(LIBDIR)
else
git clone -q --depth 10 -b main \
https://github.com/martinthomson/i-d-template $(LIBDIR)
endif
endif

0 comments on commit 42bf01c

Please sign in to comment.