Skip to content

Commit d807925

Browse files
committed
🔨 Add scripts/upload.sh
1 parent 2fdb245 commit d807925

3 files changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,29 @@ jobs:
136136
extra_luarocks_args: |
137137
--force
138138
template: tree-sitter-tmux-scm-1.rockspec
139+
- run: |
140+
luarocks install tree-sitter-tmux
141+
luarocks pack tree-sitter-tmux
142+
scripts/update.sh ./*.rock
143+
env:
144+
LUAROCKS_API_KEY: ${{secrets.LUAROCKS_API_KEY}}
145+
if: startsWith(github.ref, 'refs/tags/')
146+
147+
deploy-luarocks-macos:
148+
needs: deploy-luarocks
149+
runs-on: macos-latest
150+
if: startsWith(github.ref, 'refs/tags/')
151+
steps:
152+
- uses: leafo/gh-actions-lua@v12
153+
with:
154+
luaVersion: "5.1"
155+
- uses: leafo/gh-actions-luarocks@v6
156+
- run: |
157+
luarocks install tree-sitter-tmux
158+
luarocks pack tree-sitter-tmux
159+
scripts/update.sh ./*.rock
160+
env:
161+
LUAROCKS_API_KEY: ${{secrets.LUAROCKS_API_KEY}}
139162
140163
build-wheels:
141164
needs: test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
!/LICENCE
55
!/README.md
66
!/.github/
7+
!/scripts/
78
!/shell.nix
89

910
!/grammar.js

scripts/upload.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
for i; do
5+
file=${i%.*.rock}.rockspec
6+
version="$(curl -sLF "rockspec_file=@$file" "https://luarocks.org/api/1/$LUAROCKS_API_KEY/upload" | jq -S .version.id)"
7+
curl -sLF "rock_file=@$i" "https://luarocks.org/api/1/$LUAROCKS_API_KEY/upload_rock/$version"
8+
done

0 commit comments

Comments
 (0)