Skip to content

Commit

Permalink
Fix #3 : autopublish release
Browse files Browse the repository at this point in the history
  • Loading branch information
yne committed Jan 27, 2020
1 parent 0c1d67b commit 5418e81
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 16 deletions.
14 changes: 7 additions & 7 deletions METADATA.pb → .github/pages/METADATA.m4
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: "Picon"
vendor: "!YNE"
designer: "yne"
designer_url: "https://github.com/yne"
manufacturer: "yne"
manufacturer_url: "https://yne.fr"
designer: "OWNER"
designer_url: "REPO"
manufacturer: "OWNER"
manufacturer_url: "REPO"
license: "OFL"
license_url: "http://scripts.sil.org/OFL"
license_url: "https://scripts.sil.org/OFL"
category: "MONOSPACE"
date_added: "2020-01-20"
description: "Easy Hackable PicoIcon Set"
version: "Version 1.0; git-0000000-release"
version: "Version TAG; git-SHA-release"
fonts {
name: "Picon"
style: "normal"
Expand All @@ -20,7 +20,7 @@ fonts {
filename: "Picon-Regular.ttf"
post_script_name: "Picon-Regular"
full_name: "Picon Regular"
copyright: "Copyright 2020 The Picon Project Authors (https://github.com/yne/picon/graphs/contributors with Reserved Font Name \"Picon\")"
copyright: "Copyright 2020 The Picon Project Authors (REPO/graphs/contributors with Reserved Font Name \"Picon\")"
trademark: "Picon (tm)"
}
subsets: "menu"
Expand Down
10 changes: 5 additions & 5 deletions .github/pages/template.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype HTML>
<html lang=en>
<meta charset=utf-8>
<title>PICON - The Picon Icon Set</title>
<title>PICON - The Picon Icon Set [TAG]</title>
<meta name=description content="Easy Hackable Ligature based PicoIcon Font">
<meta name=theme-color content="#F8F8F8">
<meta name=viewport content="width=device-width, initial-scale=1">
Expand All @@ -12,14 +12,14 @@
<link rel=icon type="image/x-icon" href="/picon/favicon.ico">
<link rel=apple-touch-icon href="/picon/apple-touch-icon.png">
<article>
<a href="https://github.com/yne/picon">
<a href="REPO">
<svg id=logo viewBox="0 0 16 16"><path d="M13,4 13,0 14,0 15,2 15,0 16,0 16,4 15,4 15,4 14,2 14,4 M9,4 9,0 12,0 12,4 M6,4 6,0 8,0 8,1 7,1 7,3 8,3 8,4 M0,4 0,0 3,0 3,2 1,3 1,4 M1,1 1,2 2,2 2,1 M10,1 10,3 11,3 11,1 M6,16 6.25,15 6,8 7.25,7 7.25,5 8.75,5 8.75,7 10,8 9.75,15 10,16 M9,9.5 9,9 7,9 7,9.5 M9,12 9,10 7,10 7,12 7.5,13 8.5,13 M4,4 4,0 5,0 5,4"></path></svg>
</a>
<h1><a href="#Usage">Easy</a> <a href="#Hackable">Hackable</a> <strong><a href="#Pico">Pico</a><a href="#Icon">Icon</a></strong> <a href="#Font">Font</a></h1>
<p>SVG_COUNT Icons available as
<a href="Picon-Regular.woff2">WOFF2 Font</a> (WOFF2_SIZE)
<p>SVG_COUNT Icons <a href="REPO/releases">released</a> as
<a href="Picon-Regular.woff2">WOFF2</a> (WOFF2_SIZE)
and
<a href="Picon-Regular.tar.bz2">SVG archive</a> (BZ2_SIZE)
<a href="Picon-Regular.tar.bz2">SVG</a> (BZ2_SIZE)
</p>
include(/tmp/README)
<a href="#Icon"><h1 id=Icon>ICONS</h1></a>
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ jobs:
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
run: |
### START ###
tag=$(date +v%y.%m.%d)
[ -f /tmp/README ] || jq -n --arg text "$(<README.md)" '{"text":$text,"mode":"gfm","context":"'$GITHUB_REPOSITORY'"}' |
curl -sd @- https://api.github.com/markdown -HContent-Type:application/json |
curl -sd @- https://api.github.com/markdown |
sed -r 's/<h(.)>(\w+)/<h\1 id=\2>\2/' |
sed -r 's@.github/pages/@@g' > /tmp/README
rm -f /tmp/DATALIST /tmp/ICONLIST
Expand All @@ -27,6 +28,7 @@ jobs:
echo "<li id='$name' onclick=toggle(this,event)><img alt='$f' src='data:image/svg+xml,include($f)'/><code onclick=clip(this,event)>$name</code></li>" >> /tmp/ICONLIST
done
[ -f .github/pages/opentype.js ] || wget -qO .github/pages/opentype.js https://cdn.jsdelivr.net/npm/opentype.js
m4 -DREPO=https://github.com/${GITHUB_REPOSITORY} -DTAG=$tag -DOWNER=${GITHUB_REPOSITORY/\/*} -DSHA=${GITHUB_SHA} < .github/pages/METADATA.m4 > METADATA.pb
node .github/pages/script.js METADATA.pb svg/*.svg > Picon-Regular.otf
command -v woff2_compress || sudo apt install -y woff2
woff2_compress *.otf
Expand All @@ -36,7 +38,7 @@ jobs:
ttfautohint /tmp/Picon-Regular.ttf Picon-Regular.ttf
(cd svg ; tar cjf ../Picon-Regular.tar.bz2 *.svg)
size(){ du -sh $1 | awk '{print $1"B"}';}
m4 -DSVG_COUNT=$(ls svg/*|wc -l) -DWOFF2_SIZE=$(size *.woff2) -DBZ2_SIZE=$(size *.bz2) < .github/pages/template.html > index.html
m4 -DREPO=https://github.com/${GITHUB_REPOSITORY} -DSVG_COUNT=$(ls svg/*|wc -l) -DWOFF2_SIZE=$(size *.woff2) -DBZ2_SIZE=$(size *.bz2) < .github/pages/template.html > index.html
[ -z $GITHUB_ACTOR ] && exit
mv .github/pages/* .
git config user.name "${GITHUB_ACTOR}"
Expand All @@ -46,3 +48,12 @@ jobs:
git add .
git commit -m "$(date -u) ${GITHUB_SHA}"
git push origin_token --force
page=$(curl -v -u:${PERSONAL_TOKEN} -H "Content-Type:application/json" -d '{"tag_name": "'$tag'"}' https://api.github.com/repos/${GITHUB_REPOSITORY}/releases)
echo page is "$page"
upload_url=$(echo "$page" | jq -r .upload_url)
echo upload on $upload_url
for f in METADATA.pb Picon-*; do
curl -u:${PERSONAL_TOKEN} -H "Content-Type: $(file -b --mime-type $f)" --data-binary @$f ${upload_url/{*}?name=$f | jq .browser_download_url
done


1 change: 1 addition & 0 deletions svg/device-network.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions svg/media-nas.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion svg/person-female.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion svg/person-male.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions svg/port-lan.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5418e81

Please sign in to comment.