convert wetty from submodule to normal directory
This commit is contained in:
51
wetty/.github/workflows/build-and-test.workflow.yml
vendored
Normal file
51
wetty/.github/workflows/build-and-test.workflow.yml
vendored
Normal 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 }}
|
||||
29
wetty/.github/workflows/codeql-analysis.yml
vendored
Normal file
29
wetty/.github/workflows/codeql-analysis.yml
vendored
Normal 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
|
||||
63
wetty/.github/workflows/docker.workflow.yml
vendored
Normal file
63
wetty/.github/workflows/docker.workflow.yml
vendored
Normal 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
60
wetty/.github/workflows/publish.yml
vendored
Normal 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 }}
|
||||
23
wetty/.github/workflows/pull-requests.yml
vendored
Normal file
23
wetty/.github/workflows/pull-requests.yml
vendored
Normal 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
32
wetty/.github/workflows/release.yml
vendored
Normal 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
22
wetty/.github/workflows/stale.yml
vendored
Normal 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
|
||||
Reference in New Issue
Block a user