Compare commits

...

25 Commits

Author SHA1 Message Date
platane
a9347ab75c aaaa 2020-07-20 09:53:32 +02:00
platane
b0a6d2e94f aaaa 2020-07-20 09:40:53 +02:00
platane
250f0ba420 aaaa 2020-07-20 09:35:29 +02:00
platane
cfae6bb512 aaaa 2020-07-20 09:30:49 +02:00
platane
720b3bbf12 aaaa 2020-07-20 09:24:09 +02:00
platane
cb4016eda8 aaaa 2020-07-20 09:23:12 +02:00
platane
1a73179465 aaaa 2020-07-20 09:03:42 +02:00
platane
e62d5a56e4 aaaa 2020-07-20 09:01:47 +02:00
platane
6815912b18 aaaa 2020-07-20 08:58:27 +02:00
platane
c78ef253a1 aaaaaa 2020-07-19 21:23:05 +02:00
platane
efae6f21b5 aaaaaa 2020-07-19 21:22:24 +02:00
platane
ae99398406 aaaaaa 2020-07-19 21:16:34 +02:00
platane
505d6ab7f0 aaaaaa 2020-07-19 21:15:44 +02:00
platane
93fa60a844 aaaaaa 2020-07-19 21:10:21 +02:00
platane
e5fbdf8cfe aaaaaa 2020-07-19 21:09:33 +02:00
platane
f2452ed852 aaaaaa 2020-07-19 20:37:57 +02:00
platane
c4d7bdf2bd aaaaaa 2020-07-19 20:35:32 +02:00
platane
9b05b7fdaa aaaaaa 2020-07-19 20:20:48 +02:00
platane
ccbe4e530c aaaa 2020-07-19 20:04:40 +02:00
platane
bc6405aca3 aaaa 2020-07-19 20:03:12 +02:00
platane
fc4e8d4436 aaaa 2020-07-19 19:42:37 +02:00
platane
978ec843d3 aaaa 2020-07-19 19:37:54 +02:00
platane
c713fd8dd3 aaaabbb 2020-07-19 19:26:56 +02:00
platane
c14ae566e0 build 2020-07-19 19:26:56 +02:00
platane
724bc749a2 aaaaa 2020-07-19 19:26:56 +02:00
10 changed files with 66 additions and 34 deletions

View File

@@ -6,22 +6,22 @@ on:
- master
jobs:
test:
deploy-demo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/setup-node@v1.4.2
with:
node-version: 14
- uses: bahmutov/npm-install@v1
- uses: bahmutov/npm-install@v1.4.1
- run: yarn build:demo
env:
BASE_PATHNAME: "snk"
- uses: crazy-max/ghaction-github-pages@068e494
- uses: crazy-max/ghaction-github-pages@v2.1.1
with:
target_branch: gh-pages
build_dir: packages/demo/dist

View File

@@ -7,14 +7,35 @@ jobs:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install gifsicle graphicsmagick
# - run: sudo apt-get install gifsicle graphicsmagick
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
# - uses: actions/setup-node@v1.4.2
# with:
# node-version: 14
# - uses: bahmutov/npm-install@v1.4.1
# - run: yarn type
# - run: yarn lint
# - run: yarn test --ci
# - run: yarn build:lib
- name: generate-snake-game-from-github-contribution-grid
id: snake-gif
uses: Platane/snk@master
with:
node-version: 14
github_user_name: platane
- uses: bahmutov/npm-install@v1
# - 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: yarn type
- run: yarn lint
- run: yarn test --ci
- 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

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@ npm-debug.log*
yarn-error.log*
dist
build
out.gif

View File

@@ -4,7 +4,16 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends gifsicle graphicsmagick \
&& rm -rf /var/lib/apt/lists/*
COPY packages/action/dist/* ./github-contribution-grid-snake
COPY tsconfig.json package.json yarn.lock /github/platane.aa/
COPY packages /github/platane.aa/packages
CMD ["node", "github-contribution-grid-snake/index.js"]
RUN ( \
cd /github/platane.aa \
&& find . \
&& yarn install --frozen-lockfile \
&& yarn build:action \
&& mv packages/action/dist/* . \
&& rm -rf packages tsconfig.json package.json yarn.lock node_modules \
)
CMD ["node", "/github/platane.aa/index.js"]

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# snk
Generates a snake game from a github user contributions grid and output a screen capture as gif

View File

@@ -1,23 +1,23 @@
name: "github-contribution-grid-snake"
description: ""
name: "generate-snake-game-from-github-contribution-grid"
description: "Generates a snake game from a github user contributions grid and output a screen capture as gif"
author: "platane"
outputs:
gif_out_path:
description: ""
description: "path of the generated gif"
runs:
using: "docker"
image: "Dockerfile"
args:
- ${{ inputs.github_user_name }}
- ${{ inputs.gif_out_path }}
# args:
# - ${{ inputs.github_user_name }}
# - ${{ inputs.gif_out_path }}
inputs:
github_user_name:
description: ""
description: "github user name"
required: true
gif_out_path:
description: ""
description: "path of the generated gif"
required: false
default: "./github-contribution-grid-snake.gif"

View File

@@ -1,5 +1,6 @@
{
"name": "snk",
"description": "Generates a snake game from a github user contributions grid and output a screen capture as gif",
"version": "1.0.0",
"private": true,
"repository": "github:platane/snk",

View File

@@ -1,3 +0,0 @@
!dist
!dist/build
out.gif

View File

@@ -4,15 +4,16 @@ import { generateContributionSnake } from "./generateContributionSnake";
(async () => {
try {
console.log(core.getInput("user_name"));
console.log(core.getInput("gif_out_path"));
console.log("--");
console.log(process.cwd());
console.log("--");
console.log(fs.readdirSync(process.cwd()));
const userName = core.getInput("github_user_name");
const gifOutPath = core.getInput("gif_out_path");
const buffer = await generateContributionSnake(core.getInput("user_name"));
fs.writeFileSync(core.getInput("gif_out_path"), buffer);
const buffer = await generateContributionSnake(userName);
console.log({ userName, gifOutPath }, buffer.length);
fs.writeFileSync(gifOutPath, buffer);
console.log(`::set-output name=gif_out_path::${gifOutPath}`);
} catch (e) {
core.setFailed(`Action failed with "${e.message}"`);
}

View File

@@ -1 +0,0 @@
out.gif