Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9347ab75c | ||
|
|
b0a6d2e94f | ||
|
|
250f0ba420 | ||
|
|
cfae6bb512 | ||
|
|
720b3bbf12 | ||
|
|
cb4016eda8 | ||
|
|
1a73179465 | ||
|
|
e62d5a56e4 | ||
|
|
6815912b18 | ||
|
|
c78ef253a1 | ||
|
|
efae6f21b5 | ||
|
|
ae99398406 |
19
.github/workflows/main.yml
vendored
19
.github/workflows/main.yml
vendored
@@ -9,11 +9,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
# - run: sudo apt-get install gifsicle graphicsmagick
|
# - run: sudo apt-get install gifsicle graphicsmagick
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- uses: actions/setup-node@v1.4.2
|
# - uses: actions/setup-node@v1.4.2
|
||||||
with:
|
# with:
|
||||||
node-version: 14
|
# node-version: 14
|
||||||
|
|
||||||
- uses: bahmutov/npm-install@v1.4.1
|
# - uses: bahmutov/npm-install@v1.4.1
|
||||||
|
|
||||||
# - run: yarn type
|
# - run: yarn type
|
||||||
# - run: yarn lint
|
# - run: yarn lint
|
||||||
@@ -21,10 +21,21 @@ jobs:
|
|||||||
# - run: yarn build:lib
|
# - run: yarn build:lib
|
||||||
|
|
||||||
- name: generate-snake-game-from-github-contribution-grid
|
- name: generate-snake-game-from-github-contribution-grid
|
||||||
|
id: snake-gif
|
||||||
uses: Platane/snk@master
|
uses: Platane/snk@master
|
||||||
with:
|
with:
|
||||||
github_user_name: platane
|
github_user_name: platane
|
||||||
|
|
||||||
|
# - uses: crazy-max/ghaction-github-pages@v2.1.1
|
||||||
|
# with:
|
||||||
|
# target_branch: gh-pages
|
||||||
|
# build_dir: packages/demo/dist
|
||||||
|
# env:
|
||||||
|
# GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN_GH_PAGES }}
|
||||||
|
|
||||||
|
- run: ls
|
||||||
|
- run: ls -l github-contribution-grid-snake.gif
|
||||||
|
- run: ls -l ${{ steps.snake-gif.outputs.gif_out_path }}
|
||||||
- run: ls
|
- run: ls
|
||||||
- run: ls
|
- run: ls
|
||||||
- run: ls
|
- run: ls
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -2,4 +2,5 @@ node_modules
|
|||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
dist
|
dist
|
||||||
build
|
build
|
||||||
|
out.gif
|
||||||
19
Dockerfile
19
Dockerfile
@@ -4,13 +4,16 @@ RUN apt-get update \
|
|||||||
&& apt-get install -y --no-install-recommends gifsicle graphicsmagick \
|
&& apt-get install -y --no-install-recommends gifsicle graphicsmagick \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY tsconfig.json package.json yarn.lock ./generate-snake-game-from-github-contribution-grid/
|
COPY tsconfig.json package.json yarn.lock /github/platane.aa/
|
||||||
COPY packages ./generate-snake-game-from-github-contribution-grid/packages/
|
COPY packages /github/platane.aa/packages
|
||||||
|
|
||||||
RUN ( cd ./generate-snake-game-from-github-contribution-grid ; yarn install --frozen-lockfile )
|
RUN ( \
|
||||||
|
cd /github/platane.aa \
|
||||||
RUN ( cd ./generate-snake-game-from-github-contribution-grid ; yarn build:action )
|
&& find . \
|
||||||
|
&& yarn install --frozen-lockfile \
|
||||||
CMD ["find", "/github"]
|
&& yarn build:action \
|
||||||
# CMD ["node", "./generate-snake-game-from-github-contribution-grid/packages/action/dist/index.js"]
|
&& mv packages/action/dist/* . \
|
||||||
|
&& rm -rf packages tsconfig.json package.json yarn.lock node_modules \
|
||||||
|
)
|
||||||
|
|
||||||
|
CMD ["node", "/github/platane.aa/index.js"]
|
||||||
|
|||||||
3
packages/action/.gitignore
vendored
3
packages/action/.gitignore
vendored
@@ -1,3 +0,0 @@
|
|||||||
!dist
|
|
||||||
!dist/build
|
|
||||||
out.gif
|
|
||||||
BIN
packages/action/dist/build/Release/canvas.node
vendored
BIN
packages/action/dist/build/Release/canvas.node
vendored
Binary file not shown.
BIN
packages/action/dist/build/Release/libcairo.so.2
vendored
BIN
packages/action/dist/build/Release/libcairo.so.2
vendored
Binary file not shown.
BIN
packages/action/dist/build/Release/libcroco-0.6.so.3
vendored
BIN
packages/action/dist/build/Release/libcroco-0.6.so.3
vendored
Binary file not shown.
BIN
packages/action/dist/build/Release/libexpat.so.1
vendored
BIN
packages/action/dist/build/Release/libexpat.so.1
vendored
Binary file not shown.
BIN
packages/action/dist/build/Release/libffi.so.6
vendored
BIN
packages/action/dist/build/Release/libffi.so.6
vendored
Binary file not shown.
Binary file not shown.
BIN
packages/action/dist/build/Release/libfreetype.so.6
vendored
BIN
packages/action/dist/build/Release/libfreetype.so.6
vendored
Binary file not shown.
BIN
packages/action/dist/build/Release/libfribidi.so.0
vendored
BIN
packages/action/dist/build/Release/libfribidi.so.0
vendored
Binary file not shown.
Binary file not shown.
BIN
packages/action/dist/build/Release/libgif.so.7
vendored
BIN
packages/action/dist/build/Release/libgif.so.7
vendored
Binary file not shown.
BIN
packages/action/dist/build/Release/libgio-2.0.so.0
vendored
BIN
packages/action/dist/build/Release/libgio-2.0.so.0
vendored
Binary file not shown.
BIN
packages/action/dist/build/Release/libglib-2.0.so.0
vendored
BIN
packages/action/dist/build/Release/libglib-2.0.so.0
vendored
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
packages/action/dist/build/Release/libharfbuzz.so.0
vendored
BIN
packages/action/dist/build/Release/libharfbuzz.so.0
vendored
Binary file not shown.
BIN
packages/action/dist/build/Release/libjpeg.so.62
vendored
BIN
packages/action/dist/build/Release/libjpeg.so.62
vendored
Binary file not shown.
BIN
packages/action/dist/build/Release/libpango-1.0.so.0
vendored
BIN
packages/action/dist/build/Release/libpango-1.0.so.0
vendored
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
packages/action/dist/build/Release/libpcre.so.1
vendored
BIN
packages/action/dist/build/Release/libpcre.so.1
vendored
Binary file not shown.
BIN
packages/action/dist/build/Release/libpixman-1.so.0
vendored
BIN
packages/action/dist/build/Release/libpixman-1.so.0
vendored
Binary file not shown.
BIN
packages/action/dist/build/Release/libpng16.so.16
vendored
BIN
packages/action/dist/build/Release/libpng16.so.16
vendored
Binary file not shown.
BIN
packages/action/dist/build/Release/librsvg-2.so.2
vendored
BIN
packages/action/dist/build/Release/librsvg-2.so.2
vendored
Binary file not shown.
BIN
packages/action/dist/build/Release/libstdc++.so.6
vendored
BIN
packages/action/dist/build/Release/libstdc++.so.6
vendored
Binary file not shown.
BIN
packages/action/dist/build/Release/libxml2.so.2
vendored
BIN
packages/action/dist/build/Release/libxml2.so.2
vendored
Binary file not shown.
BIN
packages/action/dist/build/Release/libz.so.1
vendored
BIN
packages/action/dist/build/Release/libz.so.1
vendored
Binary file not shown.
174133
packages/action/dist/index.js
vendored
174133
packages/action/dist/index.js
vendored
File diff suppressed because one or more lines are too long
84
packages/action/dist/index1.js
vendored
84
packages/action/dist/index1.js
vendored
@@ -1,84 +0,0 @@
|
|||||||
const Canvas = require('./lib/canvas')
|
|
||||||
const Image = require('./lib/image')
|
|
||||||
const CanvasRenderingContext2D = require('./lib/context2d')
|
|
||||||
const parseFont = require('./lib/parse-font')
|
|
||||||
const packageJson = require('./package.json')
|
|
||||||
const bindings = require('./lib/bindings')
|
|
||||||
const fs = require('fs')
|
|
||||||
const PNGStream = require('./lib/pngstream')
|
|
||||||
const PDFStream = require('./lib/pdfstream')
|
|
||||||
const JPEGStream = require('./lib/jpegstream')
|
|
||||||
const DOMMatrix = require('./lib/DOMMatrix').DOMMatrix
|
|
||||||
const DOMPoint = require('./lib/DOMMatrix').DOMPoint
|
|
||||||
|
|
||||||
function createCanvas (width, height, type) {
|
|
||||||
return new Canvas(width, height, type)
|
|
||||||
}
|
|
||||||
|
|
||||||
function createImageData (array, width, height) {
|
|
||||||
return new bindings.ImageData(array, width, height)
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadImage (src) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
const image = new Image()
|
|
||||||
|
|
||||||
function cleanup () {
|
|
||||||
image.onload = null
|
|
||||||
image.onerror = null
|
|
||||||
}
|
|
||||||
|
|
||||||
image.onload = () => { cleanup(); resolve(image) }
|
|
||||||
image.onerror = (err) => { cleanup(); reject(err) }
|
|
||||||
|
|
||||||
image.src = src
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Resolve paths for registerFont. Must be called *before* creating a Canvas
|
|
||||||
* instance.
|
|
||||||
* @param src {string} Path to font file.
|
|
||||||
* @param fontFace {{family: string, weight?: string, style?: string}} Object
|
|
||||||
* specifying font information. `weight` and `style` default to `"normal"`.
|
|
||||||
*/
|
|
||||||
function registerFont (src, fontFace) {
|
|
||||||
// TODO this doesn't need to be on Canvas; it should just be a static method
|
|
||||||
// of `bindings`.
|
|
||||||
return Canvas._registerFont(fs.realpathSync(src), fontFace)
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
Canvas,
|
|
||||||
Context2d: CanvasRenderingContext2D, // Legacy/compat export
|
|
||||||
CanvasRenderingContext2D,
|
|
||||||
CanvasGradient: bindings.CanvasGradient,
|
|
||||||
CanvasPattern: bindings.CanvasPattern,
|
|
||||||
Image,
|
|
||||||
ImageData: bindings.ImageData,
|
|
||||||
PNGStream,
|
|
||||||
PDFStream,
|
|
||||||
JPEGStream,
|
|
||||||
DOMMatrix,
|
|
||||||
DOMPoint,
|
|
||||||
|
|
||||||
registerFont,
|
|
||||||
parseFont,
|
|
||||||
|
|
||||||
createCanvas,
|
|
||||||
createImageData,
|
|
||||||
loadImage,
|
|
||||||
|
|
||||||
backends: bindings.Backends,
|
|
||||||
|
|
||||||
/** Library version. */
|
|
||||||
version: packageJson.version,
|
|
||||||
/** Cairo version. */
|
|
||||||
cairoVersion: bindings.cairoVersion,
|
|
||||||
/** jpeglib version. */
|
|
||||||
jpegVersion: bindings.jpegVersion,
|
|
||||||
/** gif_lib version. */
|
|
||||||
gifVersion: bindings.gifVersion ? bindings.gifVersion.replace(/[^.\d]/g, '') : undefined,
|
|
||||||
/** freetype version. */
|
|
||||||
freetypeVersion: bindings.freetypeVersion
|
|
||||||
}
|
|
||||||
60
packages/action/dist/xhr-sync-worker.js
vendored
60
packages/action/dist/xhr-sync-worker.js
vendored
@@ -1,60 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
/* eslint-disable no-process-exit */
|
|
||||||
const util = require("util");
|
|
||||||
const { JSDOM } = require("../../../..");
|
|
||||||
const { READY_STATES } = require("./xhr-utils");
|
|
||||||
const idlUtils = require("../generated/utils");
|
|
||||||
const tough = require("tough-cookie");
|
|
||||||
|
|
||||||
const dom = new JSDOM();
|
|
||||||
const xhr = new dom.window.XMLHttpRequest();
|
|
||||||
const xhrImpl = idlUtils.implForWrapper(xhr);
|
|
||||||
|
|
||||||
const chunks = [];
|
|
||||||
|
|
||||||
process.stdin.on("data", chunk => {
|
|
||||||
chunks.push(chunk);
|
|
||||||
});
|
|
||||||
|
|
||||||
process.stdin.on("end", () => {
|
|
||||||
const buffer = Buffer.concat(chunks);
|
|
||||||
|
|
||||||
const flag = JSON.parse(buffer.toString());
|
|
||||||
if (flag.body && flag.body.type === "Buffer" && flag.body.data) {
|
|
||||||
flag.body = Buffer.from(flag.body.data);
|
|
||||||
}
|
|
||||||
if (flag.cookieJar) {
|
|
||||||
flag.cookieJar = tough.CookieJar.fromJSON(flag.cookieJar);
|
|
||||||
}
|
|
||||||
|
|
||||||
flag.synchronous = false;
|
|
||||||
Object.assign(xhrImpl.flag, flag);
|
|
||||||
const { properties } = xhrImpl;
|
|
||||||
xhrImpl.readyState = READY_STATES.OPENED;
|
|
||||||
try {
|
|
||||||
xhr.addEventListener("loadend", () => {
|
|
||||||
if (properties.error) {
|
|
||||||
properties.error = properties.error.stack || util.inspect(properties.error);
|
|
||||||
}
|
|
||||||
process.stdout.write(JSON.stringify({
|
|
||||||
responseURL: xhrImpl.responseURL,
|
|
||||||
status: xhrImpl.status,
|
|
||||||
statusText: xhrImpl.statusText,
|
|
||||||
properties
|
|
||||||
}), () => {
|
|
||||||
process.exit(0);
|
|
||||||
});
|
|
||||||
}, false);
|
|
||||||
xhr.send(flag.body);
|
|
||||||
} catch (error) {
|
|
||||||
properties.error += error.stack || util.inspect(error);
|
|
||||||
process.stdout.write(JSON.stringify({
|
|
||||||
responseURL: xhrImpl.responseURL,
|
|
||||||
status: xhrImpl.status,
|
|
||||||
statusText: xhrImpl.statusText,
|
|
||||||
properties
|
|
||||||
}), () => {
|
|
||||||
process.exit(0);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@@ -4,23 +4,16 @@ import { generateContributionSnake } from "./generateContributionSnake";
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
console.log("argv", process.argv);
|
const userName = core.getInput("github_user_name");
|
||||||
|
const gifOutPath = core.getInput("gif_out_path");
|
||||||
|
|
||||||
console.log(core.getInput("user_name"));
|
const buffer = await generateContributionSnake(userName);
|
||||||
console.log(core.getInput("gif_out_path"));
|
|
||||||
console.log("--");
|
|
||||||
console.log("--");
|
|
||||||
console.log(process.cwd());
|
|
||||||
console.log("--");
|
|
||||||
console.log(fs.readdirSync(process.cwd()));
|
|
||||||
console.log("--");
|
|
||||||
console.log("--");
|
|
||||||
console.log(process.env.GITHUB_WORKSPACE);
|
|
||||||
console.log("--");
|
|
||||||
console.log(fs.readdirSync(process.cwd()));
|
|
||||||
|
|
||||||
const buffer = await generateContributionSnake(core.getInput("user_name"));
|
console.log({ userName, gifOutPath }, buffer.length);
|
||||||
fs.writeFileSync(core.getInput("gif_out_path"), buffer);
|
|
||||||
|
fs.writeFileSync(gifOutPath, buffer);
|
||||||
|
|
||||||
|
console.log(`::set-output name=gif_out_path::${gifOutPath}`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
core.setFailed(`Action failed with "${e.message}"`);
|
core.setFailed(`Action failed with "${e.message}"`);
|
||||||
}
|
}
|
||||||
|
|||||||
1
packages/gif-creator/.gitignore
vendored
1
packages/gif-creator/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
out.gif
|
|
||||||
Reference in New Issue
Block a user