File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -euo pipefail
4+ IFS=$' \t\n '
5+
6+ RELEASE_NAME=" $( echo " $GITHUB_REF_NAME " | cut -d " /" -f 3-) "
7+ gh release create --verify-tag --title $RELEASE_NAME $GITHUB_REF_NAME
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -euo pipefail
4+ IFS=$' \t\n '
5+
6+ if [[ -d dist ]]; then
7+ rm -r dist
8+ fi
9+ mkdir dist
10+ cp -r tptasm modulepack.conf dist/
11+ cd dist
12+ git submodule update --init
13+ luajit ../TPT-Script-Manager/modulepack.lua modulepack.conf > tptasm.dist.lua
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -euo pipefail
4+ IFS=$' \t\n '
5+
6+ temp=.temp
7+ mkdir $temp
8+ cp $ASSET_PATH $temp /$ASSET_NAME
9+ (
10+ cd $temp
11+ gh release upload $GITHUB_REF_NAME $ASSET_NAME
12+ )
13+ rm -r $temp
14+ echo browser_download_url=https://github.com/$GITHUB_REPOSITORY /releases/download/$GITHUB_REF_NAME /$ASSET_NAME >> $GITHUB_OUTPUT
Original file line number Diff line number Diff line change 1+ name : build
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v1.*'
7+
8+ jobs :
9+ release :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v4
13+ - env :
14+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
15+ run : bash -c './.github/create-release.sh'
16+ - run : sudo apt update && sudo apt install luajit
17+ - run : ./.github/dist.sh ${{ github.ref }}
18+ - env :
19+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
20+ ASSET_PATH : dist/tptasm.dist.lua
21+ ASSET_NAME : tptasm.lua
22+ run : bash -c './.github/upload-release-asset.sh'
Original file line number Diff line number Diff line change @@ -132,13 +132,11 @@ end
132132local function all_cpus ()
133133 local co = coroutine.create (function ()
134134 local rethrow = false
135- xpcall (function ()
135+ xpcall_wrap (function ()
136136 enumerate_cpus ()
137137 end , function (err )
138- printf .err (" error inside xpcall: %s" , tostring (err ))
139- printf .info (" %s" , debug.traceback ())
140138 rethrow = true
141- end )
139+ end )()
142140 if rethrow then
143141 error (" rethrowing error from inside xpcall" )
144142 end
Original file line number Diff line number Diff line change 11local printf = require (" tptasm.printf" )
22local utility = require (" tptasm.utility" )
33
4- local function run (...)
4+ local function main (...)
55 local exit_with = 0
66
7- local args = { ... }
8- if _G .tpt and select (" #" , ... ) == 0 then
9- _G .tptasm = run
10- return exit_with
11- end
12-
137 printf .update_colour ()
148 local old_print = print
159 function print (...)
1610 printf .debug (utility .get_line (2 ), ... )
1711 end
1812
19- xpcall (function ()
13+ local args = { ... }
14+ xpcall_wrap (function ()
2015
2116 local detect = require (" tptasm.detect" )
2217 local archs = require (" tptasm.archs" )
@@ -159,14 +154,12 @@ local function run(...)
159154 exit_with = 1
160155 else
161156 -- * Dang.
162- printf .err (" error: %s" , tostring (err ))
163- printf .info (" %s" , debug.traceback ())
164157 printf .info (" this is an assembler bug, tell LBPHacker!" )
165158 printf .info (" https://github.com/LBPHacker/tptasm" )
166159 exit_with = 2
167160 end
168161
169- end )
162+ end )()
170163
171164 printf .unredirect ()
172165 printf .info (" done" )
@@ -177,6 +170,14 @@ local function run(...)
177170 return exit_with
178171end
179172
173+ local function run (...)
174+ if _G .tpt and select (" #" , ... ) == 0 then
175+ _G .tptasm = xpcall_wrap (main )
176+ return
177+ end
178+ return main (... )
179+ end
180+
180181return {
181182 run = run ,
182183}
Original file line number Diff line number Diff line change 1- local printf = setmetatable ({
1+ local printf
2+ printf = setmetatable ({
23 print = print ,
34 print_old = print ,
45 log_handle = false ,
You can’t perform that action at this time.
0 commit comments