You've already forked wakapi-readme-stats
merged with master
This commit is contained in:
44
.env.example
44
.env.example
@@ -1,22 +1,22 @@
|
|||||||
INPUT_WAKATIME_API_KEY=""
|
INPUT_WAKATIME_API_KEY=YOUR_WAKATIME_API_KEY
|
||||||
INPUT_PUSH_BRANCH_NAME="main"
|
INPUT_PUSH_BRANCH_NAME=main
|
||||||
INPUT_SECTION_NAME="waka"
|
INPUT_SECTION_NAME=waka
|
||||||
INPUT_SHOW_TIMEZONE="True"
|
INPUT_SHOW_TIMEZONE=True
|
||||||
INPUT_SHOW_PROJECTS="False"
|
INPUT_SHOW_PROJECTS=True
|
||||||
INPUT_SHOW_EDITORS="False"
|
INPUT_SHOW_EDITORS=True
|
||||||
INPUT_SHOW_OS="False"
|
INPUT_SHOW_OS=True
|
||||||
INPUT_SHOW_LANGUAGE="False"
|
INPUT_SHOW_LANGUAGE=True
|
||||||
INPUT_GH_TOKEN=""
|
INPUT_GH_TOKEN=YOUR_GITHUB_TOKEN_KEY
|
||||||
INPUT_SYMBOL_VERSION="1"
|
INPUT_SYMBOL_VERSION=1
|
||||||
INPUT_SHOW_LINES_OF_CODE="False"
|
INPUT_SHOW_LINES_OF_CODE=True
|
||||||
INPUT_SHOW_LOC_CHART="False"
|
INPUT_SHOW_LOC_CHART=True
|
||||||
INPUT_SHOW_PROFILE_VIEWS="False"
|
INPUT_SHOW_PROFILE_VIEWS=True
|
||||||
INPUT_SHOW_TOTAL_CODE_TIME="True"
|
INPUT_SHOW_TOTAL_CODE_TIME=True
|
||||||
INPUT_SHOW_SHORT_INFO="False"
|
INPUT_SHOW_SHORT_INFO=True
|
||||||
INPUT_SHOW_COMMIT="False"
|
INPUT_SHOW_COMMIT=True
|
||||||
INPUT_SHOW_DAYS_OF_WEEK="True"
|
INPUT_SHOW_DAYS_OF_WEEK=True
|
||||||
INPUT_SHOW_LANGUAGE_PER_REPO="True"
|
INPUT_SHOW_LANGUAGE_PER_REPO=True
|
||||||
INPUT_SHOW_UPDATED_DATE="True"
|
INPUT_SHOW_UPDATED_DATE=True
|
||||||
INPUT_UPDATED_DATE_FORMAT="%d/%m/%Y %H:%M:%S"
|
INPUT_UPDATED_DATE_FORMAT=%d/%m/%Y %H:%M:%S
|
||||||
INPUT_COMMIT_BY_ME="False"
|
INPUT_COMMIT_BY_ME=False
|
||||||
INPUT_COMMIT_MESSAGE="Updated with Dev Metrics"
|
INPUT_COMMIT_MESSAGE=Updated with Dev Metrics
|
||||||
|
|||||||
37
.github/workflows/build_image.yml
vendored
Normal file
37
.github/workflows/build_image.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
name: PUBLISH_IMAGE
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish-server-image:
|
||||||
|
name: Publish 'waka-readme-stats' image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout 🛎️
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Log in to the container registry 🚪
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: wakareadmestats
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker 🏋️
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
images: wakareadmestats/waka-readme-stats
|
||||||
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
|
||||||
|
- name: Build and push Docker image 🏗️
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
push: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/releases') }}
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
14
.gitignore
vendored
14
.gitignore
vendored
@@ -1,6 +1,20 @@
|
|||||||
|
# Environment files:
|
||||||
*.env
|
*.env
|
||||||
|
|
||||||
|
# Generated graph images:
|
||||||
*.png
|
*.png
|
||||||
|
|
||||||
|
# Library roots:
|
||||||
node_modules/
|
node_modules/
|
||||||
|
venv/
|
||||||
|
|
||||||
|
# Python caches:
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
|
||||||
|
# Package manager configuration files:
|
||||||
|
package.json
|
||||||
|
package-lock.json
|
||||||
|
|
||||||
|
# IDE configuration files:
|
||||||
.vscode
|
.vscode
|
||||||
|
.idea
|
||||||
|
|||||||
22
Dockerfile
22
Dockerfile
@@ -1,18 +1,14 @@
|
|||||||
FROM nikolaik/python-nodejs:python3.9-nodejs16
|
FROM nikolaik/python-nodejs:python3.9-nodejs16
|
||||||
|
|
||||||
ADD requirements.txt /requirements.txt
|
ENV PYTHONUNBUFFERED 1
|
||||||
ADD main.py /main.py
|
ENV PYTHONDONTWRITEBYTECODE 1
|
||||||
ADD loc.py /loc.py
|
|
||||||
ADD make_bar_graph.py /make_bar_graph.py
|
|
||||||
ADD translation.json /translation.json
|
|
||||||
ADD download_manager.py /download_manager.py
|
|
||||||
|
|
||||||
ENV PATH "$PATH:/home/root/.npm-global/bin"
|
WORKDIR /waka-readme-stats
|
||||||
|
|
||||||
RUN python -m pip install --upgrade pip wheel setuptools
|
ADD requirements.txt ./requirements.txt
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install --upgrade pip && pip install -r requirements.txt
|
||||||
RUN npm -g config set user root
|
RUN npm i npm@next-8 && npm i vega vega-lite vega-cli canvas
|
||||||
RUN npm i -g npm@next-8
|
|
||||||
RUN npm i -g vega vega-lite vega-cli canvas
|
|
||||||
|
|
||||||
ENTRYPOINT ["python", "/main.py"]
|
ADD sources/* ./
|
||||||
|
|
||||||
|
ENTRYPOINT python3 /waka-readme-stats/main.py
|
||||||
|
|||||||
49
Makefile
Normal file
49
Makefile
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
.ONESHELL:
|
||||||
|
.DEFAULT_GOAL = help
|
||||||
|
SHELL = /bin/bash
|
||||||
|
|
||||||
|
PATH := venv/bin:node_modules/.bin:$(PATH)
|
||||||
|
|
||||||
|
|
||||||
|
help:
|
||||||
|
@ # Print help commands
|
||||||
|
echo "Welcome to 'waka-readme-stats' GitHub Actions!"
|
||||||
|
echo "The action can be tested locally with: 'make run'."
|
||||||
|
echo "NB! For local testing Python version 3.6+ and NodeJS version between 14 and 16 are required."
|
||||||
|
echo "The action image can be built locally with: 'make container'."
|
||||||
|
echo "NB! For local container building Docker version 20+ is required."
|
||||||
|
echo "The action directory and image can be cleaned with: 'make clean'."
|
||||||
|
.PHONY: help
|
||||||
|
|
||||||
|
venv:
|
||||||
|
@ # Install Python virtual environment and dependencies
|
||||||
|
python3 -m venv venv
|
||||||
|
pip install --upgrade pip
|
||||||
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
node_modules:
|
||||||
|
@ # Install NodeJS dependencies
|
||||||
|
npm i npm@next-8
|
||||||
|
npm i vega vega-lite vega-cli canvas
|
||||||
|
|
||||||
|
|
||||||
|
run-locally: venv node_modules
|
||||||
|
@ # Run action locally
|
||||||
|
source <(cat .env.example | sed 's/=/=/' | sed 's/^/export /') && python3 ./sources/main.py
|
||||||
|
.PHONY: run-locally
|
||||||
|
|
||||||
|
run-container:
|
||||||
|
@ # Run action in container
|
||||||
|
docker build -t waka-readme-stats -f Dockerfile .
|
||||||
|
docker run --env-file .env.example waka-readme-stats
|
||||||
|
.PHONY: run-container
|
||||||
|
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@ # Clean all build files, including: libraries, package manager configs, docker images and containers
|
||||||
|
rm -rf venv
|
||||||
|
rm -rf node_modules
|
||||||
|
rm -f package*.json
|
||||||
|
docker rm -f waka-readme-stats 2>/dev/null || true
|
||||||
|
docker rmi $(docker images | grep "waka-readme-stats") 2> /dev/null || true
|
||||||
|
.PHONY: clean
|
||||||
@@ -134,7 +134,7 @@ inputs:
|
|||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'Dockerfile'
|
image: 'docker://wakareadmestats/waka-readme-stats:master'
|
||||||
|
|
||||||
branding:
|
branding:
|
||||||
icon: 'activity'
|
icon: 'activity'
|
||||||
|
|||||||
@@ -1,35 +1,11 @@
|
|||||||
altair==4.1.0
|
|
||||||
altair-data-server==0.4.1
|
|
||||||
altair-saver==0.5.0
|
|
||||||
altair-viewer==0.3.0
|
|
||||||
attrs==20.3.0
|
|
||||||
certifi==2020.12.5
|
|
||||||
cycler==0.10.0
|
|
||||||
Deprecated==1.2.12
|
|
||||||
entrypoints==0.3
|
|
||||||
httpx==0.23.3
|
|
||||||
humanize==3.3.0
|
|
||||||
idna==2.10
|
|
||||||
Jinja2==2.11.3
|
|
||||||
jsonschema==3.2.0
|
|
||||||
kiwisolver==1.3.1
|
|
||||||
MarkupSafe==1.1.1
|
|
||||||
matplotlib==3.4.1
|
|
||||||
numpy==1.20.2
|
|
||||||
pandas==1.2.3
|
|
||||||
Pillow==8.2.0
|
|
||||||
portpicker==1.3.1
|
|
||||||
PyGithub==1.54.1
|
PyGithub==1.54.1
|
||||||
PyJWT==1.7.1
|
matplotlib==3.4.1
|
||||||
PyYAML==6.0
|
|
||||||
pyparsing==2.4.7
|
|
||||||
pyrsistent==0.17.3
|
|
||||||
python-dateutil==2.8.1
|
|
||||||
python-dotenv==0.17.0
|
python-dotenv==0.17.0
|
||||||
|
numpy==1.24.1
|
||||||
|
pandas==1.2.3
|
||||||
|
altair==4.1.0
|
||||||
|
altair-saver==0.5.0
|
||||||
pytz==2021.1
|
pytz==2021.1
|
||||||
selenium==3.141.0
|
humanize==3.3.0
|
||||||
six==1.15.0
|
httpx==0.23.3
|
||||||
toolz==0.11.1
|
PyYAML==6.0
|
||||||
tornado==6.1
|
|
||||||
urllib3==1.26.5
|
|
||||||
wrapt==1.12.1
|
|
||||||
|
|||||||
0
sources/colors.json
Normal file
0
sources/colors.json
Normal file
@@ -1,15 +1,8 @@
|
|||||||
import re
|
import re
|
||||||
import os
|
|
||||||
import base64
|
|
||||||
from asyncio import sleep
|
from asyncio import sleep
|
||||||
|
|
||||||
from github import Github, InputGitAuthor, AuthenticatedUser
|
from github import Github, InputGitAuthor, AuthenticatedUser
|
||||||
import datetime
|
import datetime
|
||||||
from string import Template
|
|
||||||
import matplotlib.pyplot as plt
|
|
||||||
from io import StringIO, BytesIO
|
|
||||||
from dotenv import load_dotenv
|
|
||||||
import time
|
|
||||||
|
|
||||||
from download_manager import DownloadManager
|
from download_manager import DownloadManager
|
||||||
from make_bar_graph import BarGraph
|
from make_bar_graph import BarGraph
|
||||||
@@ -9,19 +9,14 @@ from typing import Dict
|
|||||||
|
|
||||||
from pytz import timezone
|
from pytz import timezone
|
||||||
import pytz
|
import pytz
|
||||||
from github import Github, GithubException, InputGitAuthor, AuthenticatedUser
|
from github import Github, InputGitAuthor, AuthenticatedUser
|
||||||
import datetime
|
import datetime
|
||||||
from string import Template
|
|
||||||
|
|
||||||
from download_manager import init_download_manager, DownloadManager
|
from download_manager import init_download_manager, DownloadManager
|
||||||
from loc import LinesOfCode
|
from loc import LinesOfCode
|
||||||
import time
|
|
||||||
import traceback
|
|
||||||
import humanize
|
import humanize
|
||||||
from urllib.parse import quote
|
from urllib.parse import quote
|
||||||
import json
|
import json
|
||||||
import sys
|
|
||||||
from datetime import date
|
|
||||||
import math
|
import math
|
||||||
|
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
@@ -1,11 +1,5 @@
|
|||||||
import os
|
|
||||||
from asyncio import run
|
|
||||||
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import numpy as np
|
|
||||||
import altair as alt
|
import altair as alt
|
||||||
import json
|
|
||||||
import os
|
|
||||||
|
|
||||||
from download_manager import DownloadManager
|
from download_manager import DownloadManager
|
||||||
|
|
||||||
Reference in New Issue
Block a user