From 3e662fdd2dc450326983ea3e8710d4db16f965f9 Mon Sep 17 00:00:00 2001 From: Thomas Fossati Date: Tue, 24 Sep 2024 17:51:53 +0200 Subject: [PATCH] chore: update CI --- .github/workflows/archive.yml | 18 ++++++++++++---- .github/workflows/ghpages.yml | 32 ++++++++++++++-------------- .github/workflows/publish.yml | 40 +++++++++++++++++++++-------------- .github/workflows/update.yml | 36 +++++++++++++++++++++++++++++++ 4 files changed, 90 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/update.yml diff --git a/.github/workflows/archive.yml b/.github/workflows/archive.yml index fb0e0d1..dd9429a 100644 --- a/.github/workflows/archive.yml +++ b/.github/workflows/archive.yml @@ -5,6 +5,12 @@ 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: @@ -12,21 +18,25 @@ jobs: runs-on: ubuntu-latest 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 - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ github.token }} - name: "Update GitHub Pages" uses: martinthomson/i-d-template@v1 with: make: gh-archive - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ github.token }} - name: "Save Archive" - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: path: archive.json diff --git a/.github/workflows/ghpages.yml b/.github/workflows/ghpages.yml index ddd6e1a..a1bf36e 100644 --- a/.github/workflows/ghpages.yml +++ b/.github/workflows/ghpages.yml @@ -20,38 +20,38 @@ jobs: runs-on: ubuntu-latest 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 }} + .refcache + .venv + .gems + node_modules .targets.mk - key: refcache-${{ steps.cache-setup.outputs.date }} - restore-keys: | - refcache-${{ steps.cache-setup.outputs.date }} - refcache- + 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 - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ github.token }} - name: "Archive Built Drafts" - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: path: | draft-*.html diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f9dbcab..94d885f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,6 +4,12 @@ on: push: tags: - "draft-*" + workflow_dispatch: + inputs: + email: + description: "Submitter email" + default: "" + type: string jobs: build: @@ -11,39 +17,41 @@ jobs: 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 }} + .refcache + .venv + .gems + node_modules .targets.mk - key: refcache-${{ steps.date.outputs.date }} - restore-keys: | - refcache-${{ steps.date.outputs.date }} - refcache- + 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@v2 + uses: actions/upload-artifact@v4 with: - path: "draft-*-[0-9][0-9].xml" + path: "versioned/draft-*-[0-9][0-9].*" diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 0000000..0f8d6b8 --- /dev/null +++ b/.github/workflows/update.yml @@ -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