Skip to content

Commit 1b7895d

Browse files
committed
🍱 Upload rock files to luarocks.org
1 parent e4ca249 commit 1b7895d

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ jobs:
9494
TEXMFDOTDIR: .;~/.luarocks/lib/luarocks/rocks-5.3//
9595
CGO_CFLAGS: -I/home/runner/work/texrocks/texrocks/.lua/include
9696
CXXFLAGS: -I/home/runner/work/texrocks/texrocks/.lua/include
97+
LUAROCKS_API_KEY: ${{secrets.LUAROCKS_API_KEY}}
9798
run: |
9899
rename -f s/all/macosx-aarch64/ luahbtex-*.rock
99100
texrocks/scripts/deploy.sh

scripts/deploy.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ luarocks list --porcelain |
3030
# https://github.com/luarocks/luarocks/issues/1817
3131
rename -f s/linux-x86_64/all/ {texrocks,texdef}-*.rock
3232
rename -f s/all/linux-x86_64/ luahbtex-*.rock
33+
"$WD/scripts/upload.sh" ./*.rockspec
3334
luarocks-admin make-manifest .
3435
zip manifest-5.3.zip manifest-5.3
3536
"$WD/scripts/process-index.html.pl" index.html

scripts/upload.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
for i; do
5+
json="$(curl -sLF "rockspec_file=@$i" "https://luarocks.org/api/1/$LUAROCKS_API_KEY/upload")"
6+
name="$(echo "$json" | jq -Sr '.manifests[].name')"
7+
if [[ $name == *texmf* ]]; then
8+
version="$(echo "$json" | jq -S .version.id)"
9+
for file in "${i%%rockspec}"*.rock; do
10+
curl -sLF "rock_file=@$file" "https://luarocks.org/api/1/$LUAROCKS_API_KEY/upload_rock/$version"
11+
done
12+
fi
13+
done

0 commit comments

Comments
 (0)