Publish New Draft Version #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Publish New Draft Version" | |
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@v4 | |
with: | |
fetch-depth: 0 # Fetch all history so that you can access all tags/branches | |
# See https://github.com/actions/checkout/issues/290 | |
# Fetch specific branches/tags without direct fetching into the checked-out branch | |
- name: "Get Tag Annotations" | |
run: | | |
# Fetch all the tags | |
git fetch --tags | |
# Ensure the main branch is properly set up | |
if git show-ref --verify --quiet refs/heads/main; then | |
echo "Local branch 'main' exists." | |
else | |
echo "Local branch 'main' does not exist. Checking out from origin." | |
git checkout -b main origin/main | |
fi | |
# Update origin with all branches, except for the current checked-out branch | |
git remote set-branches --add origin '*' | |
# Set upstream branch and pull updates | |
git branch --set-upstream-to=origin/main main | |
git pull --all | |
- name: "Setup" | |
id: setup | |
run: date -u "+date=%FT%T" >>"$GITHUB_OUTPUT" | |
- name: "Caching" | |
uses: actions/cache@v4 | |
with: | |
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].*" |