From fff658552cf2e1d767567b28a9c4523f3d1c230f Mon Sep 17 00:00:00 2001 From: JounQin Date: Wed, 13 Jul 2022 18:12:08 +0800 Subject: [PATCH] chore: fork release using npmmirror registry --- .changeset/README.md | 8 ++++++++ .changeset/config.json | 9 +++++++++ .github/workflows/rebase.yml | 30 +++++++++++++++++++++++++++++ .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++++++++ Readme.md | 12 ++++++++++++ package.json | 13 +++++++------ 6 files changed, 102 insertions(+), 6 deletions(-) create mode 100644 .changeset/README.md create mode 100644 .changeset/config.json create mode 100644 .github/workflows/rebase.yml create mode 100644 .github/workflows/release.yml diff --git a/.changeset/README.md b/.changeset/README.md new file mode 100644 index 000000000..e5b6d8d6a --- /dev/null +++ b/.changeset/README.md @@ -0,0 +1,8 @@ +# Changesets + +Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works +with multi-package repos, or single-package repos to help you version and publish your code. You can +find the full documentation for it [in our repository](https://github.com/changesets/changesets) + +We have a quick list of common questions to get you started engaging with this project in +[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 000000000..29c7d325f --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://unpkg.com/@changesets/config/schema.json", + "commit": false, + "linked": [], + "access": "public", + "baseBranch": "fork-release", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml new file mode 100644 index 000000000..d5e97ea94 --- /dev/null +++ b/.github/workflows/rebase.yml @@ -0,0 +1,30 @@ +name: Rebase + +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * *' + +jobs: + rebase: + name: Rebase and Push + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: fork-release + token: ${{ secrets.GH_TOKEN }} + + - name: Set Git Info + run: | + git config --global user.email admin@1stg.me + git config --global user.name JounQin + git remote add upstream https://github.com/Automattic/node-canvas.git + + - name: Rebase and Push + run: | + git fetch upstream master:master + git rebase upstream/master + git push -f diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..3f0606b20 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release + +on: + push: + branches: + - fork-release + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits + fetch-depth: 0 + + - name: Setup Node.js 16 + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Install Dependencies + run: npm install + + - name: Publish to npm + uses: changesets/action@v1 + with: + publish: npx @changesets/cli publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Sync to cnpm + run: npx cnpm sync canvas-npmmirror diff --git a/Readme.md b/Readme.md index cc945aa9a..18a6395ed 100644 --- a/Readme.md +++ b/Readme.md @@ -1,3 +1,15 @@ +# canvas-npmmirror + +A fork of [`canvas`](https://github.com/Automattic/node-canvas) using [`npmmirror`](https://npmmirror.com) as registry + +## Installation + +```bash +$ npm install canvas@npm:canvas-npmmirror +``` + +--- + # node-canvas ![Test](https://github.com/Automattic/node-canvas/workflows/Test/badge.svg) diff --git a/package.json b/package.json index 77e72328c..52d1dfe0f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "canvas", - "description": "Canvas graphics API backed by Cairo", + "name": "canvas-npmmirror", + "description": "A fork of `canvas` using `npmmirror` as registry", "version": "2.11.2", "author": "TJ Holowaychuk ", "main": "index.js", @@ -8,7 +8,8 @@ "contributors": [ "Nathan Rajlich ", "Rod Vagg ", - "Juriy Zaytsev " + "Juriy Zaytsev ", + "JounQin (https://www.1stG.me) " ], "keywords": [ "canvas", @@ -20,8 +21,8 @@ "images", "pdf" ], - "homepage": "https://github.com/Automattic/node-canvas", - "repository": "git://github.com/Automattic/node-canvas.git", + "homepage": "https://github.com/un-es/canvas-npmmirror", + "repository": "git+https://github.com/un-es/canvas-npmmirror.git", "scripts": { "prebenchmark": "node-gyp build", "benchmark": "node benchmarks/run.js", @@ -37,7 +38,7 @@ "binary": { "module_name": "canvas", "module_path": "build/Release", - "host": "https://github.com/Automattic/node-canvas/releases/download/", + "host": "https://registry.npmmirror.com/-/binary/canvas/", "remote_path": "v{version}", "package_name": "{module_name}-v{version}-{node_abi}-{platform}-{libc}-{arch}.tar.gz" },