Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release Binaries

on:
push:
tags:
- "v*"
workflow_dispatch:

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- run: bun install

- name: Get version
id: pkg
run: echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT

- name: Enforce tag matches version (on tag push)
if: startsWith(github.ref, 'refs/tags/v')
run: |
if [ "${{ github.ref_name }}" != "v${{ steps.pkg.outputs.version }}" ]; then
echo "::error::Git tag does not match package.json version"
exit 1
fi

- name: Decide release tag
id: meta
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "tag=v${{ steps.pkg.outputs.version }}" >> $GITHUB_OUTPUT
else
echo "tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT
fi

- run: mkdir -p release

- name: Build Linux x64
run: bun build ./index.ts --compile --target=bun-linux-x64 --outfile release/pezi-bot-linux-x64

- name: Build Linux arm64
run: bun build ./index.ts --compile --target=bun-linux-arm64 --outfile release/pezi-bot-linux-arm64

- name: Build macOS x64
run: bun build ./index.ts --compile --target=bun-darwin-x64 --outfile release/pezi-bot-macos-x64

- name: Build macOS arm64
run: bun build ./index.ts --compile --target=bun-darwin-arm64 --outfile release/pezi-bot-macos-arm64

- name: Build Windows x64
run: bun build ./index.ts --compile --target=bun-windows-x64 --outfile release/pezi-bot-windows-x64.exe

- name: Upload & Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.meta.outputs.tag }}
name: ${{ steps.meta.outputs.tag }}
files: release/*
generate_release_notes: true
draft: false
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Tests

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install

- name: Run tests
run: bun test --preload ./tests/setup.ts
29 changes: 28 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"name": "pezi-bot",
"module": "index.ts",
"type": "module",
"version": "1.0.0",
"author": "Bare7a <bare7a@gmail.com>",
"license": "GPL-3.0-only",
"homepage": "https://github.com/Bare7a/pezi-bot",
"description": "Pezi Bot is the ultimate Twitch chatbot, offering points, minigames, and interactive commands to engage viewers and enhance your streams.",
"scripts": {
"start": "bun run index.ts",
"build": "bun build ./index.ts --compile --outfile ./bin/pezi-bot",
Expand All @@ -12,5 +17,27 @@
},
"peerDependencies": {
"typescript": "^5.0.0"
}
},
"repository": {
"type": "git",
"url": "https://github.com/Bare7a/pezi-bot"
},
"engines": {
"bun": ">=1.3.0"
},
"bin": {
"pezi-bot": "./bin/pezi-bot"
},
"keywords": [
"twitch",
"chatbot",
"bot",
"minigames",
"trivia",
"raffle",
"slots",
"dice",
"points",
"streaming"
]
}
Loading