Skip to content

Commit ba401ec

Browse files
committed
Add workflows to generate r3plot.lua
1 parent 251f9d3 commit ba401ec

6 files changed

Lines changed: 58 additions & 1 deletion

File tree

.github/create-release.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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

.github/dist.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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 r3 modulepack.plot.conf dist/
11+
cd dist
12+
git submodule update --init
13+
luajit ../TPT-Script-Manager/modulepack.lua modulepack.plot.conf > r3plot.lua

.github/upload-release-asset.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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

.github/workflows/build.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: build
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v2.*'
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/r3plot.lua
21+
ASSET_NAME: r3plot.lua
22+
run: bash -c './.github/upload-release-asset.sh'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

TPT-Script-Manager

0 commit comments

Comments
 (0)