Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Preserve the line endings generated by the Gradle Windows wrapper.
gradlew.bat text eol=crlf
213 changes: 144 additions & 69 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,103 +3,178 @@ name: Deployment
on:
push:
tags:
# ドットをエスケープしなくていい(正規表現でない)
# ここは glob。タグの書式は parse_version で検証する。
- 'v[0-9]+.[0-9]+.[0-9]+*'
workflow_dispatch:
inputs:
tag:
description: 'ビルドする既存のタグ(例: v1.2.3-rc.1)'
required: true
type: string

permissions:
contents: read

jobs:
parse_version: # プッシュされたタグの文字列からバージョンをパースする
parse_version:
if: github.event_name != 'push' || !github.event.deleted
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
tag: ${{ steps.parse.outputs.tag }}
full_version: ${{ steps.parse.outputs.full_version }}
version: ${{ steps.parse.outputs.version }}
major: ${{ steps.parse.outputs.major }}
minor: ${{ steps.parse.outputs.minor }}
patch: ${{ steps.parse.outputs.patch }}
suffix: ${{ steps.parse.outputs.suffix }}
commit: ${{ steps.parse.outputs.commit }}
prerelease: ${{ steps.parse.outputs.prerelease }}
steps:
- name: Parse version from tag
- name: Validate tag and resolve commit
id: parse
env:
DISPATCH_TAG: ${{ inputs.tag }}
GH_TOKEN: ${{ github.token }}
run: |
FULL_VERSION=${GITHUB_REF#refs/tags/v}
VERSION=$(echo $FULL_VERSION | cut -d'-' -f1)
SUFFIX=$(echo $FULL_VERSION | cut -s -d'-' -f2-)
echo "full_version=$FULL_VERSION" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "major=$(echo $VERSION | cut -d. -f1)" >> $GITHUB_OUTPUT
echo "minor=$(echo $VERSION | cut -d. -f2)" >> $GITHUB_OUTPUT
echo "patch=$(echo $VERSION | cut -d. -f3)" >> $GITHUB_OUTPUT
echo "suffix=$SUFFIX" >> $GITHUB_OUTPUT
make: # タグから識別したバージョン情報に基づくアプリケーションを生成する
set -euo pipefail
if [[ "$GITHUB_EVENT_NAME" == 'workflow_dispatch' ]]; then
TAG=$DISPATCH_TAG
else
[[ "$GITHUB_REF" == refs/tags/* ]] || { echo 'A release requires a tag.' >&2; exit 1; }
TAG=${GITHUB_REF#refs/tags/}
fi
VERSION_PATTERN='^v([0-9]+)\.([0-9]+)\.([0-9]+)(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$'
[[ "$TAG" =~ $VERSION_PATTERN ]] || { echo 'Invalid release tag.' >&2; exit 1; }
VERSION=${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.${BASH_REMATCH[3]}
PRERELEASE=false
if [[ -n "${BASH_REMATCH[4]}" ]]; then PRERELEASE=true; fi
COMMIT=$(gh api "repos/$GITHUB_REPOSITORY/commits/refs/tags/$TAG" --jq .sha)
[[ "$COMMIT" =~ ^[0-9a-f]{40}$ ]] || { echo 'Could not resolve tag commit.' >&2; exit 1; }
if [[ "$GITHUB_EVENT_NAME" == 'push' && "$COMMIT" != "$GITHUB_SHA" ]]; then
echo 'Release tag no longer points to the pushed commit.' >&2
exit 1
fi
printf '%s\n' "tag=$TAG" "full_version=${TAG#v}" "version=$VERSION" \
"commit=$COMMIT" "prerelease=$PRERELEASE" >> "$GITHUB_OUTPUT"

make:
needs: parse_version
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
# WindowsランナーはWiX Toolset 3.14.1.8722入り
# MacOSはIntel CPU(macos-13)とApple Silicon CPU(macos-14)
# https://docs.github.com/ja/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
os: [windows-latest, macos-13, macos-14]
runs-on: ${{ matrix.os }}
needs: parse_version
include:
- os: windows-2025
target: windows-x64
extension: exe
arch_suffix: ''
- os: macos-15-intel
target: macos-x86_64
extension: dmg
arch_suffix: -x86_64
- os: macos-15
target: macos-arm64
extension: dmg
arch_suffix: -arm64
env:
APP_VERSION: ${{ needs.parse_version.outputs.full_version }}
steps:
- name: Checkout source
uses: actions/checkout@v4
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ needs.parse_version.outputs.commit }}
persist-credentials: false
- name: Setup JDK
uses: actions/setup-java@v4
uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0
with:
java-version: 21.0.1
java-version: '25'
distribution: 'temurin'
check-latest: true
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Make an application for Windows
if: (matrix.os == 'windows-latest')
run: .\gradlew.bat "-Papp.version=${{ needs.parse_version.outputs.full_version }}" make
- name: Make an application
if: (matrix.os != 'windows-latest')
run: ./gradlew "-Papp.version=${{ needs.parse_version.outputs.full_version }}" make
- name: Rename an application for Windows
if: (matrix.os == 'windows-latest')
shell: bash
run: |
mv '.\build\app\Twitch Chat Viewer-${{ needs.parse_version.outputs.version }}.exe' '.\build\app\Twitch Chat Viewer-${{ needs.parse_version.outputs.full_version }}.exe'
- name: Rename an application for Intel Mac
if: (matrix.os == 'macos-13')
shell: bash
run: |
mv "build/app/Twitch Chat Viewer-${{ needs.parse_version.outputs.version }}.dmg" "build/app/Twitch Chat Viewer-${{ needs.parse_version.outputs.full_version }}-x86_64.dmg"
- name: Rename an application for Apple Silicon Mac
if: (matrix.os == 'macos-14')
shell: bash
run: |
mv "build/app/Twitch Chat Viewer-${{ needs.parse_version.outputs.version }}.dmg" "build/app/Twitch Chat Viewer-${{ needs.parse_version.outputs.full_version }}-arm64.dmg"
- name: Detect asset file for Windows
if: (matrix.os == 'windows-latest')
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
cache-provider: basic
cache-read-only: true
- name: Build Windows installer
if: runner.os == 'Windows'
shell: pwsh
run: |
echo "asset_path=build\app\$(Get-ChildItem -name .\build\app)" >> $env:GITHUB_ENV
echo "asset_name=$(Get-ChildItem -name .\build\app)" >> $env:GITHUB_ENV
- name: Detect asset file
if: (matrix.os != 'windows-latest')
run: .\gradlew.bat "-Papp.version=$env:APP_VERSION" make
- name: Build macOS installer
if: runner.os == 'macOS'
run: ./gradlew "-Papp.version=$APP_VERSION" make
- name: Prepare installer for upload
id: installer
shell: bash
env:
NATIVE_VERSION: ${{ needs.parse_version.outputs.version }}
EXTENSION: ${{ matrix.extension }}
ARCH_SUFFIX: ${{ matrix.arch_suffix }}
run: |
echo "asset_path=build/app/$(ls build/app)" >> $GITHUB_ENV
echo "asset_name=$(ls build/app)" >> $GITHUB_ENV
- name: Upload artifacts
uses: actions/upload-artifact@v4 # https://github.com/actions/upload-artifact
source="build/app/Twitch Chat Viewer-$NATIVE_VERSION.$EXTENSION"
target="build/distribution/Twitch Chat Viewer-$APP_VERSION$ARCH_SUFFIX.$EXTENSION"
if [[ ! -f "$source" || ! -s "$source" ]]; then
echo "Missing or empty installer: $source" >&2
exit 1
fi
mkdir -p build/distribution
cp -- "$source" "$target"
printf 'path=%s\n' "$target" >> "$GITHUB_OUTPUT"
- name: Upload installer
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ${{ env.asset_name }}
path: ${{ env.asset_path }}
name: installer-${{ matrix.target }}
path: ${{ steps.installer.outputs.path }}
if-no-files-found: error
overwrite: true
compression-level: 0
- name: Upload packaging log on failure
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: packaging-log-${{ matrix.target }}
path: build/reports/packaging/make.log
if-no-files-found: ignore
overwrite: true

release:
needs: [make, parse_version]
runs-on: ubuntu-latest
needs: make
timeout-minutes: 15
permissions:
contents: write
concurrency:
group: deployment-${{ needs.parse_version.outputs.tag }}
cancel-in-progress: false
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4.1.8
- name: Download installers
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: installer-*
merge-multiple: true
path: build/distribution/
- name: Create Release
uses: softprops/action-gh-release@v2 # https://github.com/softprops/action-gh-release
- name: Verify release target
id: verify
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
GH_TOKEN: ${{ github.token }}
TAG: ${{ needs.parse_version.outputs.tag }}
COMMIT: ${{ needs.parse_version.outputs.commit }}
run: |
current=$(gh api "repos/$GITHUB_REPOSITORY/commits/refs/tags/$TAG" --jq .sha)
if [[ "$current" != "$COMMIT" ]]; then
echo "Tag $TAG changed during the build." >&2
exit 1
fi
published_tags=$(gh api --paginate "repos/$GITHUB_REPOSITORY/releases" --jq '.[] | select(.draft | not) | .tag_name')
if grep -Fxq -- "$TAG" <<< "$published_tags"; then
echo "Release $TAG is already published; its assets will not be modified." >&2
exit 1
fi
- name: Create or update draft release
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2
with:
draft: true # ドラフトリリースとし、公開は手動で行う
files: build/distribution/**
tag_name: ${{ needs.parse_version.outputs.tag }}
draft: true # 公開は手動で行う。
prerelease: ${{ needs.parse_version.outputs.prerelease == 'true' }}
fail_on_unmatched_files: true
files: |
build/distribution/*-x86_64.dmg
build/distribution/*-arm64.dmg
build/distribution/*.exe
33 changes: 27 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,39 @@ on:
- "**/*.md"
- "docs/**"

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout source
uses: actions/checkout@v4
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup JDK
uses: actions/setup-java@v4
uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0
with:
java-version: 21.0.1
java-version: '25'
distribution: 'temurin'
check-latest: true
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Test with Gradle
run: ./gradlew test
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
cache-provider: basic
- name: Test Gradle build logic
run: ./gradlew -p buildSrc test
- name: Test application
run: ./gradlew test
- name: Upload test reports on failure
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: test-reports
path: |
build/reports/tests/test
buildSrc/build/reports/tests/test
if-no-files-found: ignore
overwrite: true
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,15 @@ bin/
### Mac OS ###
.DS_Store

userinfo
userinfo

# ローカル専用の開発資料
/docs/architecture.md
/docs/development.md
/docs/technical-debt*.md
/docs/internal/

# AI
.agents
.opencode
AGENTS.md
1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
25
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Twitch Chat Viewer

[![Java CI](https://github.com/k7t3/TwitchChatViewer/actions/workflows/test.yaml/badge.svg)](https://github.com/k7t3/TwitchChatViewer/actions/workflows/test.yaml)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

このアプリケーションはライブストリーミングサービス[Twitch](https://www.twitch.tv/)の非公式チャットビューアです。

<img src="docs/images/04アプリケーション画面.png" width="1024" alt="アプリケーション画面">

[使用方法](docs/usage.md)
## ダウンロードと使い方

[リリースページ](https://github.com/k7t3/TwitchChatViewer/releases)から、お使いの OS に合ったインストーラーをダウンロードしてください。
初回起動時の Twitch 認証やチャットの開き方は、[使用方法](docs/usage.md)をご覧ください。

## 主な機能

Expand Down Expand Up @@ -41,6 +43,8 @@
### チャットメッセージのフィルタリング
* 特定のユーザーのメッセージを非表示にしたり、正規表現を使用してフィルタリングできます。

## License
## プライバシーとライセンス

詳細は [LICENSE](LICENSE.md) を参照してください。
- [プライバシーポリシー](docs/license.md#privacy-policy)
- [アプリケーションのライセンス](LICENSE.md)
- [使用ライブラリとライセンス](docs/external-libraries.md)
Loading