Fixed image upload #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- main | |
env: | |
FONT_NAME: NeoSpleen | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: FontForge | |
run: sudo apt-get install fontforge | |
- name: Increment Version | |
id: version | |
run: | | |
OLD_VERSION=$(grep -oP 'Version: "\K[^"]+' ${FONT_NAME}.sfd) | |
MAJOR=$(echo ${OLD_VERSION} | awk -F. '{print $1}') | |
MINOR=$(echo ${OLD_VERSION} | awk -F. '{print $2}') | |
NEW_VERSION="${MAJOR}.${MINOR}.${GITHUB_RUN_NUMBER}" | |
sed -i "s/Version: \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/Version: \"${NEW_VERSION}\"/g" ${FONT_NAME}.sfd | |
sed -i "s/Version +ACIA-[0-9]\+\.[0-9]\+\.[0-9]\+/Version +ACIA-${NEW_VERSION}/g" ${FONT_NAME}.sfd | |
sed -i "s/sfntRevision: 0x000[0-9]*0000/sfntRevision: 0x000${MAJOR}0000/g" ${FONT_NAME}.sfd | |
echo "version=${NEW_VERSION}" >> ${GITHUB_OUTPUT} | |
- name: Generate Font | |
run: | | |
input="${FONT_NAME}.sfd" | |
output="${FONT_NAME}.ttf" | |
fontforge -lang=ff -c "Open(\"${input}\"); Generate(\"${output}\")" | |
- name: Generate Nerd Font | |
run: | | |
wget https://github.com/ryanoasis/nerd-fonts/raw/master/FontPatcher.zip | |
unzip FontPatcher.zip -d NerdFontPatcher | |
fontforge -script NerdFontPatcher/font-patcher ${FONT_NAME}.ttf --complete --boxdrawing --no-progressbars --quiet | |
mv ${FONT_NAME}NerdFont-Regular.ttf ${FONT_NAME}-NerdFont.ttf | |
- name: Generate Showcase | |
run: | | |
sudo apt-get install python3 | |
pip3 install Pillow | |
python3 generate_showcase.py | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
*.ttf | |
Showcase-*.png | |
name: ${{ steps.version.outputs.version }} | |
tag_name: ${{ steps.version.outputs.version }} |