Skip to content

fixed workflow

fixed workflow #1

name: Upload New Graph
on:
push:
branches:
- master
jobs:
check-new-files:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: set up C++ environment and dependencies
env:
DEBIAN_FRONTEND: noninteractive
TZ: Etc/UTC
run: |
apt update
apt install -y git g++ gdb make cmake curl libcurl4-openssl-dev libcurlpp-dev nlohmann-json3-dev
- name: Compile upload
run: |
mkdir build
cmake -DCMAKE_BUILD_TYPE=Release -B build/ uploader/
make -C build/ upload
- name: Get file list needed in task
id: collect
run: |
echo "Collecting .tex files..."
files=$(git diff --name-status HEAD~10 HEAD | awk '$1 == "A" && $2 ~ /\.tex$/ { print $2 }')
echo "$files"
echo "files<<EOF" >> $GITHUB_OUTPUT
echo "$files" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Run upload on each file
env:
WIKITOKEN: ${{ secrets.WIKITOKEN }}
run: |
echo "Running command for each .tex file:"
echo "${{steps.collect.outputs.files }}" | while read filepath; do
[ -z "$filepath" ] && continue
echo "Processing file: $filepath"
done