diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..5ebeb04 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,42 @@ +name: Publish + +on: + push: + tags: + - "**" + workflow_dispatch: + +jobs: + publish: + name: Publish + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install PNPM + uses: pnpm/action-setup@v3 + + - name: Install Node + uses: actions/setup-node@v4.0.2 + with: + cache: "pnpm" + + - name: Install dependencies + run: pnpm i + + - name: Install tooling + uses: ok-nick/setup-aftman@v0.4.2 + with: + cache: true + + - name: Build package + id: export + run: echo "tarball=$(pnpm export | tail -n 1)" >> "$GITHUB_OUTPUT" + + - name: Publish artifacts + uses: ncipollo/release-action@v1 + with: + artifacts: "${{ steps.export.outputs.tarball }}" + body: "See [CHANGELOG.md](https://github.com/0x5eal/wg-lua/blob/main/CHANGELOG.md) for more details." + draft: true diff --git a/.lune/bundle.luau b/.lune/bundle.luau index 3ea0eed..f24dfa0 100644 --- a/.lune/bundle.luau +++ b/.lune/bundle.luau @@ -58,10 +58,8 @@ function main() if path == LUAU_TYPES_PATH then bundle = fs.readFile(LUAU_TYPES_PATH) - print(bundle) elseif path == TS_TYPES_PATH then bundle = fs.readFile(TS_TYPES_PATH) - print(bundle) end path = "out/" .. path:split("/")[3] diff --git a/package.json b/package.json index 7f947eb..aae1b7a 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "A lua implementation of the wireguard keygen algorithm.", "main": "out/init.lua", "scripts": { + "export": "pnpm build && pnpm pack", "build": "rbxtsc --verbose && ./lunew bundle", "watch": "rbxtsc -w", "lint": "eslint src",