Merge pull request #43 from scratchfoundation/rd/ENG-48/paper-js-to-gha

Move PaperJS to GitHub Actions
This commit is contained in:
Ron de las Alas 2023-10-31 13:13:17 -04:00 committed by GitHub
commit 0cb100e30a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 2310 additions and 453 deletions

View file

@ -1,69 +0,0 @@
version: 2.1
orbs:
node: circleci/node@5
commands:
deploy_npm:
steps:
- run:
# This assumes the git user info is already configured
name: Deploy to NPM
command: |
export RELEASE_VERSION="0.11.$(date +%Y%m%d%H%M%S)"
if [[ "$CIRCLE_BRANCH" == hotfix/* ]]; then
export NPM_TAG=hotfix
else
export NPM_TAG=latest
fi
echo "Deploying version $RELEASE_VERSION to $NPM_TAG"
npm --no-git-tag-version version $RELEASE_VERSION
npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN
npm publish --tag $NPM_TAG
if npm info | grep -q $RELEASE_VERSION; then
git tag $RELEASE_VERSION
git push \
https://${GH_TOKEN}@github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git \
$RELEASE_VERSION
fi
jobs:
default:
docker:
- image: circleci/node:10-browsers # TODO: switch to cimg/node:* after upgrading gulp
steps:
- checkout
- run: git submodule update --init --recursive
- run:
name: Setup
command: |
sudo apt update
sudo apt install libgif-dev
TRAVIS_BRANCH="${CIRCLECI_BRANCH}" travis/setup-git.sh # Configure git user info
travis/install-assets.sh
npm set progress=false
which gulp || sudo npm install -g gulp-cli
- node/install-packages
- run: gulp jshint
- run: gulp minify
- run: gulp test
- run: gulp zip
- when:
condition:
or:
- equal: [ master, <<pipeline.git.branch>> ]
- equal: [ develop, <<pipeline.git.branch>> ]
- matches: { pattern: "^hotfix.*", value: <<pipeline.git.branch>> }
- matches: { pattern: "^release.*", value: <<pipeline.git.branch>> }
steps:
- run:
name: travis/deploy-prebuilt.sh
command: |
TRAVIS_TAG="${CIRCLE_TAG}" TRAVIS_COMMIT="${CIRCLE_SHA1}" travis/deploy-prebuilt.sh
- deploy_npm
workflows:
version: 2
default:
jobs:
- default:
context:
- dockerhub-credentials
- scratch-npm-creds

1
.github/CODEOWNERS.md vendored Normal file
View file

@ -0,0 +1 @@
@scratchfoundation/scratch-engineering

56
.github/workflows/deploy.yml vendored Normal file
View file

@ -0,0 +1,56 @@
on:
push: # Runs whenever a commit is pushed to the repository...
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
permissions:
contents: write
jobs:
build-deploy:
runs-on: ubuntu-latest
env:
JVM_OPTS: -Xmx3200m
JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-exports java.base/sun.nio.ch=ALL-UNNAMED
steps:
- uses: actions/checkout@v4
- uses: wagoid/commitlint-github-action@v5
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 17
- name: Setup submodule
run: git submodule update --init --recursive
- uses: actions/setup-node@v2
with:
cache: "npm"
node-version-file: ".nvmrc"
- name: Info
run: |
cat <<EOF
Node version: $(node --version)
NPM version: $(npm --version)
GitHub ref: ${{ github.ref }}
GitHub head ref: ${{ github.head_ref }}
EOF
- name: Setup
run: |
# sudo apt update
# sudo apt install libgif-dev
TRAVIS_BRANCH="${{github.ref_name}}" travis/setup-git.sh # Configure git user info
travis/install-assets.sh
npm set progress=false
which gulp || npm install -g gulp-cli
- name: Install NPM Dependencies
run: |
npm ci --legacy-peer-deps
- run: gulp jshint
- run: gulp minify
- run: gulp test
- run: gulp zip
- name: Tag build
if: (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/develop') || startsWith(github.ref, 'refs/heads/hotfix') || startsWith(github.ref, 'refs/heads/release')
run: |
TRAVIS_TAG="${{github.ref_name}}" TRAVIS_COMMIT="${{github.sha}}" travis/deploy-prebuilt.sh

1
.gitignore vendored
View file

@ -1,3 +1,2 @@
.nvmrc
node_modules/
dist/*

1
.nvmrc Normal file
View file

@ -0,0 +1 @@
v10

View file

@ -1,9 +1,11 @@
{
"compilerOptions": {
"target": "ES5",
"strictNullChecks": true
"strictNullChecks": false
},
"files" : [
"typescript-definition-test.ts"
]
],
"exclude": [
"node_modules"]
}

File diff suppressed because it is too large Load diff

View file

@ -389,7 +389,7 @@ item.hitTestAll(point);
item.hitTestAll(point, {});
item.matches({});
item.matches(callback);
item.matches(name, {});
item.matches(item.name, {});
item.getItems({});
item.getItems(callback);
item.getItem({});

1490
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -9,7 +9,10 @@
"url": "https://github.com/paperjs/paper.js"
},
"bugs": "https://github.com/paperjs/paper.js/issues",
"contributors": ["Jürg Lehni <juerg@scratchdisk.com> (http://scratchdisk.com)", "Jonathan Puckey <jonathan@puckey.studio> (http://studiomoniker.com)"],
"contributors": [
"Jürg Lehni <juerg@scratchdisk.com> (http://scratchdisk.com)",
"Jonathan Puckey <jonathan@puckey.studio> (http://studiomoniker.com)"
],
"main": "dist/paper-full.js",
"types": "dist/paper.d.ts",
"scripts": {
@ -21,7 +24,14 @@
"jshint": "gulp jshint",
"test": "gulp test"
},
"files": ["AUTHORS.md", "CHANGELOG.md", "dist/", "examples/", "LICENSE.txt", "README.md"],
"files": [
"AUTHORS.md",
"CHANGELOG.md",
"dist/",
"examples/",
"LICENSE.txt",
"README.md"
],
"engines": {
"node": ">=8.0.0"
},
@ -31,6 +41,9 @@
"pre-push": "gulp test --ensure-branch develop"
}
},
"overrides": {
"graceful-fs": "^4.2.11"
},
"browser": {
"canvas": false,
"jsdom": false,
@ -51,7 +64,8 @@
"gulp-prepro": "^2.4.0",
"gulp-qunits": "^2.1.2",
"gulp-rename": "^1.4.0",
"gulp-shell": "^0.7.0",
"gulp-typescript": "^5.0.0",
"gulp-shell": "^0.8.0",
"gulp-symlink": "^2.1.4",
"gulp-uglify": "^1.5.4",
"gulp-uncomment": "^0.3.0",
@ -74,7 +88,23 @@
"source-map-support": "^0.5.12",
"stats.js": "0.17.0",
"straps": "^3.0.1",
"typescript": "^3.1.6"
"typescript": "^4.8.2"
},
"keywords": ["vector", "graphic", "graphics", "2d", "geometry", "bezier", "curve", "curves", "path", "paths", "canvas", "svg", "paper", "paper.js", "paperjs"]
"keywords": [
"vector",
"graphic",
"graphics",
"2d",
"geometry",
"bezier",
"curve",
"curves",
"path",
"paths",
"canvas",
"svg",
"paper",
"paper.js",
"paperjs"
]
}

View file

@ -26,7 +26,7 @@ echo "https://${GH_TOKEN}:@github.com" > .git/credentials
# fetch = +refs/heads/*:refs/remotes/origin/*
# We can change the fetch setting by removing and adding the origin again:
git remote remove origin
git remote add origin https://github.com/paperjs/paper.js.git
git remote add origin https://github.com/scratchfoundation/paper.js.git
# Avoid detached head...
git checkout $TRAVIS_BRANCH