Compare commits

..

6 commits

Author SHA1 Message Date
f56a7a3266
[eventsub] Suspicious user topics were moved from beta to v1
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2024-04-13 17:29:14 +02:00
932879c8df
prepare release v3.29.2 2024-04-13 14:19:20 +02:00
97dbc74ebc
CI: Fix missing permissions in workflow
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2024-04-13 14:13:36 +02:00
2c9d8ef33c
prepare release v3.29.1 2024-04-13 14:01:53 +02:00
de3a4941ed
CI: Fix bugs in new CI flow
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2024-04-13 13:55:54 +02:00
8dd3d7db0c
prepare release v3.29.0 2024-04-13 13:17:00 +02:00
13 changed files with 118 additions and 184 deletions

View file

@ -1,7 +1,7 @@
name: CI Workflow
on: push
permissions:
packages: write
contents: read
jobs:
doc-generator:
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
@ -11,7 +11,7 @@ jobs:
run:
shell: bash
container:
image: luzifer/archlinux
image: luzifer/gh-arch-env
env:
CGO_ENABLED: 0
GOPATH: /go
@ -21,18 +21,11 @@ jobs:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Install required packages
run: |
pacman -Syy --noconfirm \
curl \
git \
git-lfs \
make \
tar
- uses: actions/checkout@v4
with:
lfs: true
show-progress: false
submodules: true
- name: Marking workdir safe
run: git config --global --add safe.directory /__w/twitch-bot/twitch-bot
- name: Generate documentation
@ -50,11 +43,12 @@ jobs:
defaults:
run:
shell: bash
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
show-progress: false
- name: Log into registry
uses: docker/login-action@v3
@ -72,7 +66,7 @@ jobs:
run:
shell: bash
container:
image: luzifer/archlinux
image: luzifer/gh-arch-env
env:
CGO_ENABLED: 0
GOPATH: /go
@ -80,16 +74,12 @@ jobs:
services:
crdb:
image: luzifer/crdb-gh-service
options: --health-cmd "curl -sSf http://localhost:8080/health" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Enable custom AUR package repo
run: echo -e "[luzifer]\nSigLevel = Never\nServer = https://archrepo.hub.luzifer.io/\$arch" >>/etc/pacman.conf
- name: Install required packages
run: |
pacman -Syy --noconfirm \
cockroachdb-bin \
git \
go \
make
cockroachdb-bin
- uses: actions/checkout@v4
with:
show-progress: false
@ -115,7 +105,7 @@ jobs:
run:
shell: bash
container:
image: luzifer/archlinux
image: luzifer/gh-arch-env
env:
CGO_ENABLED: 0
GOPATH: /go
@ -127,15 +117,11 @@ jobs:
MYSQL_PASSWORD: twitch-bot-pass
MYSQL_ROOT_PASSWORD: root-pass
MYSQL_USER: twitch-bot
options: --health-cmd "healthcheck.sh --connect --innodb_initialized" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Enable custom AUR package repo
run: echo -e "[luzifer]\nSigLevel = Never\nServer = https://archrepo.hub.luzifer.io/\$arch" >>/etc/pacman.conf
- name: Install required packages
run: |
pacman -Syy --noconfirm \
git \
go \
make \
mariadb-clients
- uses: actions/checkout@v4
with:
@ -161,7 +147,7 @@ jobs:
run:
shell: bash
container:
image: luzifer/archlinux
image: luzifer/gh-arch-env
env:
CGO_ENABLED: 0
GOPATH: /go
@ -173,15 +159,11 @@ jobs:
MYSQL_PASSWORD: twitch-bot-pass
MYSQL_ROOT_PASSWORD: root-pass
MYSQL_USER: twitch-bot
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Enable custom AUR package repo
run: echo -e "[luzifer]\nSigLevel = Never\nServer = https://archrepo.hub.luzifer.io/\$arch" >>/etc/pacman.conf
- name: Install required packages
run: |
pacman -Syy --noconfirm \
git \
go \
make \
mariadb-clients
- uses: actions/checkout@v4
with:
@ -207,7 +189,7 @@ jobs:
run:
shell: bash
container:
image: luzifer/archlinux
image: luzifer/gh-arch-env
env:
CGO_ENABLED: 0
GOPATH: /go
@ -217,15 +199,8 @@ jobs:
image: postgres:15
env:
POSTGRES_PASSWORD: twitch-bot-pass
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Enable custom AUR package repo
run: echo -e "[luzifer]\nSigLevel = Never\nServer = https://archrepo.hub.luzifer.io/\$arch" >>/etc/pacman.conf
- name: Install required packages
run: |
pacman -Syy --noconfirm \
git \
go \
make
- uses: actions/checkout@v4
with:
show-progress: false
@ -244,35 +219,16 @@ jobs:
run:
shell: bash
container:
image: luzifer/archlinux
image: luzifer/gh-arch-env
env:
CGO_ENABLED: 0
GOPATH: /go
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Enable custom AUR package repo
run: echo -e "[luzifer]\nSigLevel = Never\nServer = https://archrepo.hub.luzifer.io/\$arch" >>/etc/pacman.conf
- name: Install required packages
run: |
pacman -Syy --noconfirm \
awk \
curl \
diffutils \
git \
git-lfs \
go \
golangci-lint-bin \
make \
nodejs-lts-hydrogen \
npm \
tar \
trivy \
unzip \
which \
zip
- uses: actions/checkout@v4
with:
lfs: true
show-progress: false
- name: Marking workdir safe
run: |
@ -282,13 +238,11 @@ jobs:
- name: Extract changelog
run: awk "/^#/ && ++c==2{exit}; /^#/f" "History.md" | tail -n +2 >release_changelog.md
- name: Update stable branch
if: startsWith(github.ref, 'refs/tags/')
run: |
git branch -f stable ${GITHUB_SHA}
git push -f origin stable
- name: Release
uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/')
with:
artifacts: .build/*
bodyFile: release_changelog.md
@ -300,35 +254,14 @@ jobs:
run:
shell: bash
container:
image: luzifer/archlinux
image: luzifer/gh-arch-env
env:
CGO_ENABLED: 0
GOPATH: /go
runs-on: ubuntu-latest
steps:
- name: Enable custom AUR package repo
run: echo -e "[luzifer]\nSigLevel = Never\nServer = https://archrepo.hub.luzifer.io/\$arch" >>/etc/pacman.conf
- name: Install required packages
run: |
pacman -Syy --noconfirm \
awk \
curl \
diffutils \
git \
git-lfs \
go \
golangci-lint-bin \
make \
nodejs-lts-hydrogen \
npm \
tar \
trivy \
unzip \
which \
zip
- uses: actions/checkout@v4
with:
lfs: true
show-progress: false
- name: Marking workdir safe
run: |

View file

@ -1,3 +1,66 @@
# 3.29.2 / 2024-04-13
> [!IMPORTANT]
> This release introduces a new configuration validation which might lead to your bot not starting as of stronger type checking of actor settings. To validate the config is fine run a validation against the config once before replacing the bot binary / Docker image:
>
> `./twitch-bot --storage-conn-string "file::memory:?cache=shared" -c path/to/config.yaml validate-config`
>
> Using the connection string shown above will use a non-persistent database and can be used while the existing bot is running.
* New Features
* [eventsub] Add support for suspicious user events
* Improvements
* [core] Enforce attribute type schema validation on config
* [core] Remove deprecated fallback token / token migration
* [counter] Allow `counterTopList` to specify how to sort
* [counter] Record first seen and last updated on counters
* [counter] Revise template parsing logic
* [docs] Add field-type annotations to events
* [spotify] Improve error handling / documentation
* [spotify] Switch to PKCE flow, remove need for clientSecret
* Bugfixes
* [core] Fix: Do not retry core-kv query when it's not set
* [core] Fix: Don't initialize twitch client before start checks
* [eventsub] Fix: Fetching existing subscriptions broken
> [!NOTE]
> In case you're using the DockerHub Docker images and rely on the presence of the `stable` tag please switch to the [Github Registry](https://github.com/Luzifer/twitch-bot/pkgs/container/twitch-bot) and use the `latest` tag. Development releases are published as `develop`. The `stable` tag will not be updated beyond `v3.28.1`, DockerHub images are currently still supported but will be faded out.
> [!NOTE]
> Re-release of v3.29.0 as of broken tests in that release, no functional changes.
# 3.29.0 / 2024-04-13
> [!IMPORTANT]
> This release introduces a new configuration validation which might lead to your bot not starting as of stronger type checking of actor settings. To validate the config is fine run a validation against the config once before replacing the bot binary / Docker image:
>
> `./twitch-bot --storage-conn-string "file::memory:?cache=shared" -c path/to/config.yaml validate-config`
>
> Using the connection string shown above will use a non-persistent database and can be used while the existing bot is running.
* New Features
* [eventsub] Add support for suspicious user events
* Improvements
* [core] Enforce attribute type schema validation on config
* [core] Remove deprecated fallback token / token migration
* [counter] Allow `counterTopList` to specify how to sort
* [counter] Record first seen and last updated on counters
* [counter] Revise template parsing logic
* [docs] Add field-type annotations to events
* [spotify] Improve error handling / documentation
* [spotify] Switch to PKCE flow, remove need for clientSecret
* Bugfixes
* [core] Fix: Do not retry core-kv query when it's not set
* [core] Fix: Don't initialize twitch client before start checks
* [eventsub] Fix: Fetching existing subscriptions broken
> [!NOTE]
> In case you're using the DockerHub Docker images and rely on the presence of the `stable` tag please switch to the [Github Registry](https://github.com/Luzifer/twitch-bot/pkgs/container/twitch-bot) and use the `latest` tag. Development releases are published as `develop`. The `stable` tag will not be updated beyond `v3.28.1`, DockerHub images are currently still supported but will be faded out.
# 3.28.1 / 2024-04-02
* New Features

View file

@ -36,7 +36,7 @@ frontend_lint: node_modules
src
node_modules:
npm ci
npm ci --include dev
# --- Tools

View file

@ -2,6 +2,6 @@ name: CI Workflow
on: push
permissions:
packages: write
contents: read
jobs: {}

View file

@ -8,7 +8,7 @@ defaults:
shell: bash
container:
image: luzifer/archlinux
image: luzifer/gh-arch-env
env:
CGO_ENABLED: 0
GOPATH: /go
@ -21,20 +21,11 @@ permissions:
runs-on: ubuntu-latest
steps:
- name: Install required packages
run: |
pacman -Syy --noconfirm \
curl \
git \
git-lfs \
make \
tar
- uses: actions/checkout@v4
with:
lfs: true
show-progress: false
submodules: true
- name: Marking workdir safe
run: git config --global --add safe.directory /__w/twitch-bot/twitch-bot

View file

@ -7,12 +7,14 @@ defaults:
run:
shell: bash
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
show-progress: false
- name: Log into registry

View file

@ -8,7 +8,7 @@ defaults:
shell: bash
container:
image: luzifer/archlinux
image: luzifer/gh-arch-env
env:
CGO_ENABLED: 0
GOPATH: /go
@ -18,18 +18,17 @@ runs-on: ubuntu-latest
services:
crdb:
image: luzifer/crdb-gh-service
options: >-
--health-cmd "curl -sSf http://localhost:8080/health"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Enable custom AUR package repo
run: echo -e "[luzifer]\nSigLevel = Never\nServer = https://archrepo.hub.luzifer.io/\$arch" >>/etc/pacman.conf
- name: Install required packages
run: |
pacman -Syy --noconfirm \
cockroachdb-bin \
git \
go \
make
cockroachdb-bin
- uses: actions/checkout@v4
with:

View file

@ -8,7 +8,7 @@ defaults:
shell: bash
container:
image: luzifer/archlinux
image: luzifer/gh-arch-env
env:
CGO_ENABLED: 0
GOPATH: /go
@ -22,17 +22,16 @@ services:
MYSQL_PASSWORD: twitch-bot-pass
MYSQL_ROOT_PASSWORD: root-pass
MYSQL_USER: twitch-bot
options: >-
--health-cmd "healthcheck.sh --connect --innodb_initialized"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Enable custom AUR package repo
run: echo -e "[luzifer]\nSigLevel = Never\nServer = https://archrepo.hub.luzifer.io/\$arch" >>/etc/pacman.conf
- name: Install required packages
run: |
pacman -Syy --noconfirm \
git \
go \
make \
mariadb-clients
- uses: actions/checkout@v4

View file

@ -8,7 +8,7 @@ defaults:
shell: bash
container:
image: luzifer/archlinux
image: luzifer/gh-arch-env
env:
CGO_ENABLED: 0
GOPATH: /go
@ -22,17 +22,16 @@ services:
MYSQL_PASSWORD: twitch-bot-pass
MYSQL_ROOT_PASSWORD: root-pass
MYSQL_USER: twitch-bot
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Enable custom AUR package repo
run: echo -e "[luzifer]\nSigLevel = Never\nServer = https://archrepo.hub.luzifer.io/\$arch" >>/etc/pacman.conf
- name: Install required packages
run: |
pacman -Syy --noconfirm \
git \
go \
make \
mariadb-clients
- uses: actions/checkout@v4

View file

@ -8,7 +8,7 @@ defaults:
shell: bash
container:
image: luzifer/archlinux
image: luzifer/gh-arch-env
env:
CGO_ENABLED: 0
GOPATH: /go
@ -20,18 +20,13 @@ services:
image: postgres:15
env:
POSTGRES_PASSWORD: twitch-bot-pass
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Enable custom AUR package repo
run: echo -e "[luzifer]\nSigLevel = Never\nServer = https://archrepo.hub.luzifer.io/\$arch" >>/etc/pacman.conf
- name: Install required packages
run: |
pacman -Syy --noconfirm \
git \
go \
make
- uses: actions/checkout@v4
with:
show-progress: false

View file

@ -8,39 +8,19 @@ defaults:
shell: bash
container:
image: luzifer/archlinux
image: luzifer/gh-arch-env
env:
CGO_ENABLED: 0
GOPATH: /go
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Enable custom AUR package repo
run: echo -e "[luzifer]\nSigLevel = Never\nServer = https://archrepo.hub.luzifer.io/\$arch" >>/etc/pacman.conf
- name: Install required packages
run: |
pacman -Syy --noconfirm \
awk \
curl \
diffutils \
git \
git-lfs \
go \
golangci-lint-bin \
make \
nodejs-lts-hydrogen \
npm \
tar \
trivy \
unzip \
which \
zip
- uses: actions/checkout@v4
with:
lfs: true
show-progress: false
- name: Marking workdir safe
@ -54,14 +34,12 @@ steps:
run: 'awk "/^#/ && ++c==2{exit}; /^#/f" "History.md" | tail -n +2 >release_changelog.md'
- name: Update stable branch
if: startsWith(github.ref, 'refs/tags/')
run: |
git branch -f stable ${GITHUB_SHA}
git push -f origin stable
- name: Release
uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/')
with:
artifacts: '.build/*'
bodyFile: release_changelog.md

View file

@ -7,7 +7,7 @@ defaults:
shell: bash
container:
image: luzifer/archlinux
image: luzifer/gh-arch-env
env:
CGO_ENABLED: 0
GOPATH: /go
@ -15,31 +15,8 @@ container:
runs-on: ubuntu-latest
steps:
- name: Enable custom AUR package repo
run: echo -e "[luzifer]\nSigLevel = Never\nServer = https://archrepo.hub.luzifer.io/\$arch" >>/etc/pacman.conf
- name: Install required packages
run: |
pacman -Syy --noconfirm \
awk \
curl \
diffutils \
git \
git-lfs \
go \
golangci-lint-bin \
make \
nodejs-lts-hydrogen \
npm \
tar \
trivy \
unzip \
which \
zip
- uses: actions/checkout@v4
with:
lfs: true
show-progress: false
- name: Marking workdir safe

View file

@ -234,7 +234,6 @@ func (t *twitchWatcher) getTopicRegistrations(userID string) []topicRegistration
},
{
Topic: twitch.EventSubEventTypeChannelSuspiciousUserMessage,
Version: twitch.EventSubTopicVersionBeta,
Condition: twitch.EventSubCondition{BroadcasterUserID: userID, ModeratorUserID: userID},
RequiredScopes: []string{twitch.ScopeModeratorReadSuspiciousUsers},
Hook: t.handleEventSubSusUserMessage,
@ -242,7 +241,6 @@ func (t *twitchWatcher) getTopicRegistrations(userID string) []topicRegistration
},
{
Topic: twitch.EventSubEventTypeChannelSuspiciousUserUpdate,
Version: twitch.EventSubTopicVersionBeta,
Condition: twitch.EventSubCondition{BroadcasterUserID: userID, ModeratorUserID: userID},
RequiredScopes: []string{twitch.ScopeModeratorReadSuspiciousUsers},
Hook: t.handleEventSubSusUserUpdate,