Compare commits

...

8 Commits

Author SHA1 Message Date
Platane
825e58e5fd 📦 1.1.2 2022-03-24 12:14:48 +00:00
platane
9232c14971 👷 fix release script 2022-03-24 13:11:04 +01:00
Platane
cd3320efff 📦 1.1.1 2022-03-24 12:05:22 +00:00
platane
553d8d8efa 📓 2022-03-24 13:00:13 +01:00
platane
e80a44ca5f 🔨 fix svg rounded square 2022-03-24 12:56:26 +01:00
platane
4ced502e11 📓 update readme 2022-03-24 12:43:09 +01:00
Platane
0374e20a50 📦 1.1.0 2022-03-24 11:25:21 +00:00
platane
7ba88d1fbd 📓 2022-03-24 12:21:27 +01:00
9 changed files with 25 additions and 17 deletions

View File

@@ -36,7 +36,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: update action.yml
- name: update action.yml to use image from local Dockerfile
run: |
sed -i "s/image: .*/image: Dockerfile/" action.yml

View File

@@ -32,7 +32,8 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v2
- name: build and publish the docker image
uses: docker/build-push-action@v2
id: docker-build
with:
push: true
@@ -40,7 +41,7 @@ jobs:
platane/snk:${{ github.sha }}
platane/snk:${{ github.event.inputs.version }}
- name: update action.yml
- name: update action.yml to point to the newly created docker image
run: |
sed -i "s/image: .*/image: docker:\/\/platane\/snk@${{ steps.docker-build.outputs.digest }}/" action.yml
@@ -49,19 +50,20 @@ jobs:
cache: yarn
node-version: 16
- name: bump version
run: yarn version --no-git-tag-version --new-version ${{ github.event.inputs.version }}
- name: build svg-only action
run: |
yarn install --frozen-lockfile
yarn build:action
rm -r svg-only/dist
mv packages/action/dist svg-only/dist
- name: bump package version
run: yarn version --no-git-tag-version --new-version ${{ github.event.inputs.version }}
- name: push new commit
uses: EndBug/add-and-commit@v7
with:
add: package.json svg-only action.yml
add: package.json svg-only/dist action.yml
message: 📦 ${{ github.event.inputs.version }}
tag: v${{ github.event.inputs.version }}

View File

@@ -1,6 +1,6 @@
# snk
[![GitHub marketplace](https://img.shields.io/badge/marketplace-snake-blue?logo=github&style=flat-square)](https://github.com/marketplace/actions/generate-snake-game-from-github-contribution-grid)
[![GitHub marketplace](https://img.shields.io/github/v/tag/platane/snk?label=marketplace&logo=github&sort=semver&style=flat-square)](https://github.com/marketplace/actions/generate-snake-game-from-github-contribution-grid)
![type definitions](https://img.shields.io/npm/types/typescript?style=flat-square)
![code style](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)
@@ -20,7 +20,7 @@ Available as github action. Automatically generate a new image at the end of the
**github action**
```yaml
- uses: Platane/snk@master
- uses: Platane/snk@v1.1.0
with:
# github user name to read the contribution graph from (**required**)
# using action context var `github.repository_owner` or specified user
@@ -35,7 +35,9 @@ Available as github action. Automatically generate a new image at the end of the
svg_out_path: dist/github-snake.svg
```
> [example with cron job](https://github.com/Platane/Platane/blob/master/.github/workflows/main.yml#L24-L29)
[example with cron job](https://github.com/Platane/Platane/blob/master/.github/workflows/main.yml#L24-L29)
If you are only interested in generating a svg, you can use this other faster action: `uses: Platane/snk/svg-only@v1.1.0`
**interactive demo**

View File

@@ -4,7 +4,7 @@ author: "platane"
runs:
using: docker
image: docker://platane/snk@sha256:767615f6d5cc39228b8adb364346ab585821020eb604ab353a5f55edb90bf2d0
image: docker://platane/snk@sha256:9c3604282bdf9cf367dc955545fff9e4a893e5716ee88701d8924fd2377dbc72
inputs:
github_user_name:

View File

@@ -1,7 +1,7 @@
{
"name": "snk",
"description": "Generates a snake game from a github user contributions grid",
"version": "1.0.2-rc.6",
"version": "1.1.2",
"private": true,
"repository": "github:platane/snk",
"devDependencies": {

View File

@@ -5,7 +5,9 @@
"@actions/core": "1.6.0",
"@snk/gif-creator": "1.0.0",
"@snk/github-user-contribution": "1.0.0",
"@snk/svg-creator": "1.0.0"
"@snk/solver": "1.0.0",
"@snk/svg-creator": "1.0.0",
"@snk/types": "1.0.0"
},
"devDependencies": {
"@zeit/ncc": "0.22.3",

View File

@@ -22,8 +22,6 @@ export const createGrid = (
const styles = [
`.c{
shape-rendering: geometricPrecision;
rx: ${sizeBorderRadius};
ry: ${sizeBorderRadius};
fill: var(--ce);
stroke-width: 1px;
stroke: var(--cb);
@@ -56,6 +54,8 @@ export const createGrid = (
class: ["c", id].filter(Boolean).join(" "),
x: x * s + m,
y: y * s + m,
rx: sizeBorderRadius,
ry: sizeBorderRadius,
width: d,
height: d,
})

View File

@@ -6,4 +6,4 @@ As a drawback, it can not generate gif image.
## Build process
file is built and push on release, by the release action.
dist file are built and push on release, by the release action.

View File

@@ -36516,7 +36516,7 @@ var createGrid = function (cells, _a, duration) {
var sizeBorderRadius = _a.sizeBorderRadius, sizeDot = _a.sizeDot, sizeCell = _a.sizeCell;
var svgElements = [];
var styles = [
".c{\n shape-rendering: geometricPrecision;\n rx: ".concat(sizeBorderRadius, ";\n ry: ").concat(sizeBorderRadius, ";\n fill: var(--ce);\n stroke-width: 1px;\n stroke: var(--cb);\n animation: none ").concat(duration, "ms linear infinite;\n }"),
".c{\n shape-rendering: geometricPrecision;\n fill: var(--ce);\n stroke-width: 1px;\n stroke: var(--cb);\n animation: none ".concat(duration, "ms linear infinite;\n }"),
];
var i = 0;
for (var _i = 0, cells_1 = cells; _i < cells_1.length; _i++) {
@@ -36536,6 +36536,8 @@ var createGrid = function (cells, _a, duration) {
"class": ["c", id].filter(Boolean).join(" "),
x: x * s + m,
y: y * s + m,
rx: sizeBorderRadius,
ry: sizeBorderRadius,
width: d,
height: d
}));