chore: import upstream snapshot with attribution
Coverage / build (push) Has been cancelled
Docker / Build (push) Has been cancelled
Docker / Publish (push) Has been cancelled
Node.js CI / build (16, macos-latest) (push) Has been cancelled
Node.js CI / build (16, ubuntu-latest) (push) Has been cancelled
Node.js CI / build (16, windows-latest) (push) Has been cancelled
NPM / Build (22) (push) Has been cancelled
NPM / Pack (push) Has been cancelled
NPM / Publish (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 12:40:42 +08:00
commit d5f55b5f9c
197 changed files with 21977 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
name: Coverage
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: |
echo See: https://github.com/wechaty/wechaty/issues/2242
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v2
# - run: npm install
# - run: |
# npm test
# npm run coverage
# env:
# CI: true
# - name: Coveralls
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
+55
View File
@@ -0,0 +1,55 @@
name: Docker
on: [push, pull_request]
# push:
# branches:
# - main
# - 'v[0-9]+*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: reviewdog/action-shellcheck@v1
- name: Install Bats
run: |
curl -sSL -o /tmp/bats_v0.4.0.tar.gz https://github.com/sstephenson/bats/archive/v0.4.0.tar.gz
tar -xf /tmp/bats_v0.4.0.tar.gz
sudo bats-0.4.0/install.sh /usr/local
- name: Build the Docker image
run: ./scripts/docker.sh build
- name: Test the Docker image
run: ./scripts/docker.sh test
# https://www.prestonlamb.com/blog/creating-a-docker-image-with-github-actions
publish:
name: Publish
needs: [build]
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/v'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
install: true
version: latest
- name: Builder instance name
run: echo ${{ steps.buildx.outputs.name }}
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Login to DockerHub Registry
run: echo ${{ secrets.DOCKER_PERSONAL_ACCESS_TOKEN }} | docker login -u zixia --password-stdin
- name: Deploy to Docker Hub
run: ./scripts/docker.sh deploy
+36
View File
@@ -0,0 +1,36 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
strategy:
matrix:
os:
- macos-latest
- windows-latest
- ubuntu-latest
node-version:
- 16
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: package.json
- run: npm install
- run: npm run build --if-present
- run: npm test
env:
CI: true
+88
View File
@@ -0,0 +1,88 @@
name: NPM
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- 22
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: package.json
- name: Install Dependencies
run: |
node --version
npm --version
npm install
- name: Test
run: npm test
pack:
name: Pack
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: package.json
- run: npm install
- name: Generate Package JSON
run: ./scripts/generate-package-json.sh
- run: ./scripts/npm-pack-testing.sh
env:
WECHATY_PUPPET_PADPLUS_TOKEN: ${{ secrets.WECHATY_PUPPET_PADPLUS_TOKEN }}
publish:
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/v'))
name: Publish
needs: [build, pack]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/
cache: npm
cache-dependency-path: package.json
- run: npm install
- name: Generate Package JSON
run: ./scripts/generate-package-json.sh
- run: ./scripts/package-publish-config-tag.sh
- run: npm run dist
- name: Check Branch
id: check-branch
run: |
if [[ ${{ github.ref }} =~ ^refs/heads/(main|v[0-9]+\.[0-9]+.*)$ ]]; then
echo ::set-output name=match::true
fi # See: https://stackoverflow.com/a/58869470/1123955
- name: Is A Publish Branch
if: steps.check-branch.outputs.match == 'true'
run: |
NAME=$(npx pkg-jq -r .name)
VERSION=$(npx pkg-jq -r .version)
if npx version-exists "$NAME" "$VERSION"
then echo "$NAME@$VERSION exists on NPM, skipped."
else echo "Publishing..." && npm publish
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Is Not A Publish Branch
if: steps.check-branch.outputs.match != 'true'
run: echo 'Not A Publish Branch'