Skip to content

Commit

Permalink
Merge branch 'release/0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed Feb 9, 2020
2 parents 713ec10 + c1d58e2 commit d32fbf6
Show file tree
Hide file tree
Showing 10 changed files with 2,995 additions and 1,549 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: main

on:
push:
pull_request:
types: [opened, synchronize]

jobs:
build:
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
- run: cd frontend && npm ci
- run: cd frontend && GH_CARD_IMAGE_SERVER_URL=https://gh-card.dev npm run build

- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: './frontend/dist'
production-branch: master
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

## [Unreleased]

## [0.2.0] - 2020-02-09
### Changed
* Update dependencies
* Set fork icon when repo is forked

## 0.1.0 - 2020-02-08
### Added
* Initial release

[Unreleased]: https://github.com/nwtgck/gh-card/compare/v0.1.0...HEAD
[0.2.0]: https://github.com/nwtgck/gh-card/compare/v0.1.0...v0.2.0
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0
0.2.0
1 change: 1 addition & 0 deletions backend/src/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export function createServer(
description: githubRepoJson.description ?? "",
nStars: githubRepoJson.stargazers_count,
nForks: githubRepoJson.forks_count,
isFork: githubRepoJson.fork,
});
const svgStr: string = renderToString(svg);

Expand Down
13 changes: 9 additions & 4 deletions backend/src/svg-generator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ function getGitHubNetworkMemberUrl(ownerName: string, shortRepoName: string): st
}

export function generateSvg(
{ownerName, shortRepoName, usesFullName: usesFullName, linkTarget, language, description, nStars, nForks}:
{ownerName: string, shortRepoName: string, usesFullName: boolean, linkTarget: string, language: string | undefined, description: string, nStars: number, nForks: number}
{ownerName, shortRepoName, usesFullName: usesFullName, linkTarget, language, description, nStars, nForks, isFork}:
{ownerName: string, shortRepoName: string, usesFullName: boolean, linkTarget: string, language: string | undefined, description: string, nStars: number, nForks: number, isFork: boolean}
): {width: number, height: number, svg: JSX.Element} {
// Name on image
const repoNameInImage: string = usesFullName ? `${ownerName}/${shortRepoName}` : shortRepoName
Expand Down Expand Up @@ -107,8 +107,13 @@ export function generateSvg(
{/* Boarder */}
<rect x="0" y="0" width="441" height={height} stroke="#eaecef" stroke-width="2" />
<g fill="#586069" fill-opacity="1" stroke="none" transform="matrix(1.25,0,0,1.25,17,21)">
{/* Repo icon like book */}
<path vector-effect="none" fill-rule="evenodd" d="M4,9 L3,9 L3,8 L4,8 L4,9 M4,6 L3,6 L3,7 L4,7 L4,6 M4,4 L3,4 L3,5 L4,5 L4,4 M4,2 L3,2 L3,3 L4,3 L4,2 M12,1 L12,13 C12,13.55 11.55,14 11,14 L6,14 L6,16 L4.5,14.5 L3,16 L3,14 L1,14 C0.45,14 0,13.55 0,13 L0,1 C0,0.45 0.45,0 1,0 L11,0 C11.55,0 12,0.45 12,1 M11,11 L1,11 L1,13 L3,13 L3,12 L6,12 L6,13 L11,13 L11,11 M11,1 L2,1 L2,10 L11,10 L11,1" />
{
(isFork)
// Fork icon
? <path fill-rule="evenodd" d="M8 1a1.993 1.993 0 00-1 3.72V6L5 8 3 6V4.72A1.993 1.993 0 002 1a1.993 1.993 0 00-1 3.72V6.5l3 3v1.78A1.993 1.993 0 005 15a1.993 1.993 0 001-3.72V9.5l3-3V4.72A1.993 1.993 0 008 1zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3 10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3-10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"></path>
// Repo icon like book
: <path vector-effect="none" fill-rule="evenodd" d="M4,9 L3,9 L3,8 L4,8 L4,9 M4,6 L3,6 L3,7 L4,7 L4,6 M4,4 L3,4 L3,5 L4,5 L4,4 M4,2 L3,2 L3,3 L4,3 L4,2 M12,1 L12,13 C12,13.55 11.55,14 11,14 L6,14 L6,16 L4.5,14.5 L3,16 L3,14 L1,14 C0.45,14 0,13.55 0,13 L0,1 C0,0.45 0.45,0 1,0 L11,0 C11.55,0 12,0.45 12,1 M11,11 L1,11 L1,13 L3,13 L3,12 L6,12 L6,13 L11,13 L11,11 M11,1 L2,1 L2,10 L11,10 L11,1" />
}
</g>
<g fill="#0366d6" fill-opacity="1" stroke="#0366d6" stroke-opacity="1" stroke-width="1" stroke-linecap="square" stroke-linejoin="bevel" transform="matrix(1,0,0,1,0,0)">
{/* Repo name */}
Expand Down
1 change: 1 addition & 0 deletions backend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ export const githubRepoJsonType = t.type({
language: t.union([t.string, t.undefined]),
stargazers_count: t.number,
forks_count: t.number,
fork: t.boolean,
});
export type GithubRepoJson = t.TypeOf<typeof githubRepoJsonType>;
2 changes: 1 addition & 1 deletion frontend/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
presets: [
'@vue/app'
'@vue/cli-plugin-babel/preset'
]
}
Loading

0 comments on commit d32fbf6

Please sign in to comment.