convert wetty from submodule to normal directory

This commit is contained in:
douboer@gmail.com
2026-03-03 16:07:18 +08:00
parent 1db76701a6
commit 0d185d2b3c
131 changed files with 15543 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

21
wetty/.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
---
version: 2
updates:
- package-ecosystem: npm
directory: '/'
schedule:
interval: weekly
commit-message:
prefix: '[NPM] '
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: weekly
commit-message:
prefix: '[GH action] '
- package-ecosystem: docker
directory: '/containers'
schedule:
interval: weekly
commit-message:
prefix: '[docker] '

View File

@@ -0,0 +1,51 @@
---
name: Build & Test
on:
workflow_call:
inputs:
working-directory:
required: false
type: string
default: '.'
jobs:
build_and_test:
name: Build & Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.working-directory }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup env
uses: actions/setup-node@v3
with:
node-version: 22
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: ESLint checks
run: pnpm lint
- run: pnpm build
name: Compile Typescript
- run: pnpm test
name: Run tests
env:
CI: true
- uses: actions/cache@v3
id: restore-build
with:
path: ./*
key: ${{ github.sha }}

View File

@@ -0,0 +1,29 @@
---
name: Code Scanning - Action
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 11 * * 1'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: javascript
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

View File

@@ -0,0 +1,63 @@
---
name: Docker Workflow
on:
workflow_call:
inputs:
platforms:
required: true
type: string
push:
type: boolean
default: false
secrets:
DOCKERHUB_USERNAME:
DOCKERHUB_TOKEN:
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
wettyoss/wetty
ghcr.io/butlerx/wetty
flavor: |
latest=true
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: containers/wetty/Dockerfile
platforms: ${{ inputs.platforms }}
push: ${{ inputs.push }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ steps.meta.outputs.tags }}
cache-to: type=inline

60
wetty/.github/workflows/publish.yml vendored Normal file
View File

@@ -0,0 +1,60 @@
---
name: Build and Publish
on:
push:
branches:
- main
jobs:
test:
name: Build & Test
uses: ./.github/workflows/build-and-test.workflow.yml
publish:
runs-on: ubuntu-latest
needs: test
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup env
uses: actions/setup-node@v3
with:
node-version: 22
cache: 'pnpm'
- uses: actions/cache@v3
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
# Publish to NPM
- name: Publish if version has been updated
uses: pascalgn/npm-publish-action@1.3.9
with:
tag_name: 'v%s'
tag_message: 'v%s'
commit_pattern: "^Release (\\S+)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.npm_token }}
# Publish to Github PKG
- uses: actions/setup-node@v3
with:
node-version: 22
registry-url: 'https://npm.pkg.github.com'
- name: Publish to Github PKG if version has been updated
uses: pascalgn/npm-publish-action@1.3.9
with:
create_tag: false
commit_pattern: "^Release (\\S+)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -0,0 +1,23 @@
---
name: Run tests
on:
pull_request:
jobs:
test:
name: Build & Test
uses: ./.github/workflows/build-and-test.workflow.yml
validate-docker:
name: Validate Docker Build
uses: ./.github/workflows/docker.workflow.yml
strategy:
matrix:
platform:
- linux/amd64
- linux/arm/v6
- linux/arm/v7
- linux/arm64
secrets: inherit
with:
platforms: ${{ matrix.platform }}
push: false

32
wetty/.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
---
name: Create Release
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Create Release
uses: fregante/release-with-changelog@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: 'Release {tag}'
exclude: true
commit-template: '- {title} ← {hash}'
template: |
### Changelog
{commits}
{range}
docker:
name: Docker Publish Image
uses: ./.github/workflows/docker.workflow.yml
secrets: inherit
with:
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
push: true

22
wetty/.github/workflows/stale.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
---
name: Mark stale issues and pull requests
on:
schedule:
- cron: '39 10 * * *'
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
days-before-close: 21
days-before-stale: 365