Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions .github/hotcrp.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# HotCRP submission settings.
# HOTCRP_TOKEN is intentionally not stored here. Configure it as a GitHub
# Actions repository secret, or provide it in the local environment.
HOTCRP_ACTION_UPLOAD_ENABLED=false
HOTCRP_SITE_URL=https://asplos26.hotcrp.com
Comment thread
hhkit marked this conversation as resolved.
Outdated
HOTCRP_PID=TODO
154 changes: 85 additions & 69 deletions .github/workflows/build_paper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ name: Compile paper
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions: write-all

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on: [push, pull_request]
# Controls when the action will run. Triggers the workflow on push, pull request,
# or a manual run from the GitHub Actions UI.
on:
push:
pull_request:
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -15,79 +18,92 @@ jobs:

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: Create .latexminted_config file
run: |
bash ./tools/create_latexminted_config.sh
make .latexminted_config

# Uses the latest TeXLive distribution (currently with minted v3+)
- name: Compile paper
uses: xu-cheng/latex-action@master
with:
root_file: paper.tex

# Uses the latest TeXLive distribution (currently with minted v3+)
- name: Compile submission
uses: xu-cheng/latex-action@master
with:
root_file: submission.tex

- name: Release
if: ${{ github.event_name == 'push' }}
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Release ${{ github.run_number }}
tag_name: release-${{ github.run_number }}
files: |
paper.pdf
submission.pdf
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: Create .latexminted_config file
run: |
bash ./tools/create_latexminted_config.sh
make .latexminted_config

# Uses the latest TeXLive distribution (currently with minted v3+)
- name: Compile paper
uses: xu-cheng/latex-action@master
with:
root_file: paper.tex

# Uses the latest TeXLive distribution (currently with minted v3+)
- name: Compile submission
uses: xu-cheng/latex-action@master
with:
root_file: submission.tex

- name: Release
if: ${{ github.event_name == 'push' }}
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Release ${{ github.run_number }}
tag_name: release-${{ github.run_number }}
files: |
paper.pdf
submission.pdf

- name: Set up Python for HotCRP response validation
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Upload to HotCRP
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
env:
HOTCRP_TOKEN: ${{ secrets.HOTCRP_TOKEN }}
run: bash ./tools/upload-to-hotcrp.sh .github/hotcrp.env

Comment thread
hhkit marked this conversation as resolved.
build-texlive-2024:
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Uses an older TeXLive distribution (with minted v2.9)
- name: Compile paper
uses: xu-cheng/latex-action@master
with:
docker_image: ghcr.io/xu-cheng/texlive-full:20240901
root_file: paper.tex

# Uses an older TeXLive distribution (with minted v2.9)
- name: Compile submission
uses: xu-cheng/latex-action@master
with:
docker_image: ghcr.io/xu-cheng/texlive-full:20240901
root_file: submission.tex
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Uses an older TeXLive distribution (with minted v2.9)
- name: Compile paper
uses: xu-cheng/latex-action@master
with:
docker_image: ghcr.io/xu-cheng/texlive-full:20240901
root_file: paper.tex

# Uses an older TeXLive distribution (with minted v2.9)
- name: Compile submission
uses: xu-cheng/latex-action@master
with:
docker_image: ghcr.io/xu-cheng/texlive-full:20240901
root_file: submission.tex
build-texlive-2022:
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Uses an older TeXLive distribution (with minted v2.6)
- name: Compile paper
uses: xu-cheng/latex-action@v3
with:
docker_image: ghcr.io/xu-cheng/texlive-full:20221101
root_file: paper.tex
latexmk_shell_escape: true

# Uses an older TeXLive distribution (with minted v2.6)
- name: Compile submission
uses: xu-cheng/latex-action@v3
with:
docker_image: ghcr.io/xu-cheng/texlive-full:20221101
root_file: submission.tex
latexmk_shell_escape: true
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Uses an older TeXLive distribution (with minted v2.6)
- name: Compile paper
uses: xu-cheng/latex-action@v3
with:
docker_image: ghcr.io/xu-cheng/texlive-full:20221101
root_file: paper.tex
latexmk_shell_escape: true

# Uses an older TeXLive distribution (with minted v2.6)
- name: Compile submission
uses: xu-cheng/latex-action@v3
with:
docker_image: ghcr.io/xu-cheng/texlive-full:20221101
root_file: submission.tex
latexmk_shell_escape: true
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Download:
[Paper (with comments)](../../releases/latest/download/paper.pdf)
[Submission (without comments)](../../releases/latest/download/submission.pdf) |


### Conference: ASPLOS

- Abstract: 2025-08-13T23:59:00-05:00
Expand Down Expand Up @@ -67,3 +68,28 @@ git merge upstream/main
```bash
tools/generate_lexers_json.py
```

## HotCRP CI/CD

This repository has support for opt-in automatic submission of `submission.pdf` to HotCRP on every push to main.
This requires setting up the submission in HotCRP first.

0. Assume the HotCRP site is hosted at https://asplos26.hotcrp.com
1. Create the paper submission on the HotCRP website. `HOTCRP_PID` is the paper's submission ID in the URL (eg. `https://asplos26.hotcrp.com/paper/HOTCRP_PID`)
2. Create an Authentication Token in HotCRP's **Account Settings**: (eg. `https://asplos26.hotcrp.com/profile/developer`)
3. Set up `.github/hotcrp.env` with the values from HotCRP, and set `HOTCRP_ACTION_UPLOAD_ENABLED=true` to enable uploading by GitHub Actions.

```sh
HOTCRP_SITE_URL=https://asplos26.hotcrp.com
HOTCRP_PID=TODO
HOTCRP_ACTION_UPLOAD_ENABLED=true # This toggle enables the GitHub workflow
```

4. Lastly, add the `HOTCRP_TOKEN` repository secret in GitHub under **Settings -> Secrets and variables -> Actions**.

The submission script can also be run locally instead of via GitHub actions.
Don't forget to provide the token in the environment.

```sh
HOTCRP_TOKEN=... bash tools/upload-to-hotcrp.sh .github/hotcrp.env
```
135 changes: 135 additions & 0 deletions tools/upload-to-hotcrp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
#!/usr/bin/env bash
set -euo pipefail

default_config_file=".github/hotcrp.env"
config_file="${1:-$default_config_file}"

usage() {
cat <<'EOF'
Usage:
tools/upload-to-hotcrp.sh [CONFIG_FILE]
tools/upload-to-hotcrp.sh --help

Uploads a paper PDF to the configured HotCRP submission.

CONFIG_FILE is sourced as a shell env file. If omitted, .github/hotcrp.env is
sourced when it exists; otherwise existing environment variables are used.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually accurate w.r.t what's implemented?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now it is

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👦 written not 🤖


Required values:
HOTCRP_SITE_URL HotCRP site base URL, for example https://asplos26.hotcrp.com
HOTCRP_PID Numeric HotCRP paper ID
HOTCRP_TOKEN HotCRP API token

GitHub Actions control:
HOTCRP_ACTION_UPLOAD_ENABLED
In GitHub Actions, must be exactly true to upload.
Defaults to false.

Optional overrides:
HOTCRP_PDF PDF to upload. Defaults to submission.pdf.

Local example:
HOTCRP_TOKEN=... tools/upload-to-hotcrp.sh .github/hotcrp.env
HOTCRP_SITE_URL=... HOTCRP_PID=123 HOTCRP_TOKEN=... tools/upload-to-hotcrp.sh
EOF
}

die() {
printf 'error: %s\n' "$*" >&2
exit 1
}

require_var() {
local name="$1"
local value="${!name:-}"

if [ -z "$value" ] || [ "$value" = "TODO" ] || [ "$value" = "TODO_REPLACE_ME" ]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [ -z "$value" ] || [ "$value" = "TODO" ] || [ "$value" = "TODO_REPLACE_ME" ]; then
if [ -z "$value" ] || [ "$value" = "TODO" ]; then

Do we really need to check for two different todo values?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we now check for all the TODO values

die "$name is not set. Update $config_file or provide it in the environment."
fi
}

require_command() {
local name="$1"

command -v "$name" >/dev/null 2>&1 || die "required command is not available: $name"
}

case "${1:-}" in
-h|--help)
usage
exit 0
;;
esac

if [ "$#" -gt 0 ] || [ -f "$config_file" ]; then
[ -f "$config_file" ] || die "missing HotCRP config file: $config_file"

set -a
# shellcheck source=/dev/null
. "$config_file"
set +a
fi

HOTCRP_ACTION_UPLOAD_ENABLED="${HOTCRP_ACTION_UPLOAD_ENABLED:-false}"
HOTCRP_PDF="${HOTCRP_PDF:-submission.pdf}"

if [ "${GITHUB_ACTIONS:-false}" = "true" ] && [ "$HOTCRP_ACTION_UPLOAD_ENABLED" != "true" ]; then
printf 'HotCRP upload is disabled by %s; set HOTCRP_ACTION_UPLOAD_ENABLED=true to enable it.\n' "$config_file"
exit 0
fi

require_var HOTCRP_SITE_URL
require_var HOTCRP_PID
require_var HOTCRP_TOKEN

require_command curl
require_command python3
require_command zip

HOTCRP_SITE_URL="${HOTCRP_SITE_URL%/}"

case "$HOTCRP_PID" in
''|*[!0-9]*)
die "HOTCRP_PID must be a numeric paper ID."
;;
esac

[ -f "$HOTCRP_PDF" ] || die "missing PDF to upload: $HOTCRP_PDF"

workdir="$(mktemp -d)"
trap 'rm -rf "$workdir"' EXIT

cp "$HOTCRP_PDF" "$workdir/submission.pdf"

cat > "$workdir/data.json" <<EOF
{
"object": "paper",
"pid": $HOTCRP_PID,
"submission": { "content_file": "submission.pdf" }
}
EOF

(
cd "$workdir"
zip -q upload.zip data.json submission.pdf
)

curl -fsS \
-H "Authorization: bearer $HOTCRP_TOKEN" \
-H "Content-Type: application/zip" \
--data-binary @"$workdir/upload.zip" \
"$HOTCRP_SITE_URL/api/paper" \
> hotcrp-response.json

python3 - <<'PY'
import json
import sys

with open("hotcrp-response.json") as f:
response = json.load(f)

print(json.dumps(response, indent=2))

if not response.get("ok") or not response.get("valid", False):
sys.exit("HotCRP upload failed")
PY
Loading