-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (41 loc) · 1.31 KB
/
upload-new-graph.yml
File metadata and controls
41 lines (41 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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