Skip to content

Commit 53898cb

Browse files
committed
Added Debian package for Mono Sans/Mono fonts
1 parent 3fd3a60 commit 53898cb

1 file changed

Lines changed: 136 additions & 26 deletions

File tree

.github/workflows/release.yml

Lines changed: 136 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ permissions:
1919
jobs:
2020
build:
2121
runs-on: ubuntu-latest
22+
outputs:
23+
version: ${{ steps.version.outputs.version }}
24+
tag: ${{ steps.version.outputs.tag }}
25+
tag_name: ${{ steps.version.outputs.tag }}
2226

2327
steps:
2428
- name: Checkout code
@@ -75,63 +79,169 @@ jobs:
7579
fonts/ -x "fonts/googlefonts/*" -x "fonts/googlefonts/**" \
7680
OFL.txt README.md
7781
82+
- name: Upload release zip artifacts
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: mona-sans-release-zips-v${{ steps.version.outputs.version }}
86+
path: release-artifacts/*.zip
87+
88+
- name: Upload font build artifacts
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: mona-sans-fonts-v${{ steps.version.outputs.version }}
92+
path: fonts/
93+
94+
build-deb:
95+
runs-on: ubuntu-24.04
96+
needs: [build]
97+
98+
steps:
99+
- name: Checkout code
100+
uses: actions/checkout@v4
101+
102+
- name: Download font artifacts
103+
uses: actions/download-artifact@v4
104+
with:
105+
name: mona-sans-fonts-v${{ needs.build.outputs.version }}
106+
path: fonts/
107+
108+
- name: Extract version
109+
id: version
110+
run: |
111+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
112+
VERSION="${{ github.event.inputs.version }}"
113+
else
114+
VERSION=${GITHUB_REF#refs/tags/v}
115+
fi
116+
# Normalize version for Debian (replace hyphens, ensure it starts with a digit)
117+
DEB_VERSION=$(echo "$VERSION" | sed 's/^v//')
118+
echo "version=${DEB_VERSION}" >> $GITHUB_OUTPUT
119+
120+
- name: Build .deb package
121+
run: |
122+
PKG="fonts-mona-sans"
123+
VERSION="${{ steps.version.outputs.version }}"
124+
DEB_DIR="${PKG}_${VERSION}_all"
125+
126+
# Create package directory structure
127+
mkdir -p "${DEB_DIR}/DEBIAN"
128+
mkdir -p "${DEB_DIR}/usr/share/fonts/truetype/mona-sans"
129+
mkdir -p "${DEB_DIR}/usr/share/fonts/truetype/mona-sans-variable"
130+
mkdir -p "${DEB_DIR}/usr/share/doc/${PKG}"
131+
132+
# Install static TTF files (Mona Sans + Mona Sans Mono)
133+
cp fonts/static/ttf/*.ttf "${DEB_DIR}/usr/share/fonts/truetype/mona-sans/"
134+
135+
# Install variable TTF files (Mona Sans VF + Mona Sans Mono VF)
136+
cp fonts/variable/*.ttf "${DEB_DIR}/usr/share/fonts/truetype/mona-sans-variable/"
137+
138+
# Install license as Debian copyright file
139+
cp OFL.txt "${DEB_DIR}/usr/share/doc/${PKG}/copyright"
140+
141+
# Create control file
142+
cat > "${DEB_DIR}/DEBIAN/control" << EOF
143+
Package: ${PKG}
144+
Version: ${VERSION}
145+
Architecture: all
146+
Section: fonts
147+
Priority: optional
148+
Depends: fontconfig
149+
Installed-Size: $(du -sk "${DEB_DIR}/usr" | cut -f1)
150+
Maintainer: GitHub <opensource+mona-sans@github.com>
151+
Homepage: https://github.com/github/mona-sans
152+
Description: Mona Sans and Mona Sans Mono typeface families
153+
Mona Sans is a versatile typeface designed by GitHub together with
154+
Degarism, inspired by industrial-era grotesques. It works well across
155+
product, web, and print. This package includes both Mona Sans (with
156+
weight range 200-900 and width range 75-125) and Mona Sans Mono, in
157+
static and variable font formats.
158+
EOF
159+
160+
# Strip leading whitespace from control file (heredoc indentation)
161+
sed -i 's/^ //' "${DEB_DIR}/DEBIAN/control"
162+
163+
# Create triggers for fontconfig cache update
164+
printf 'activate-noawait update-fontconfig-caches\n' > "${DEB_DIR}/DEBIAN/triggers"
165+
166+
# Build the package
167+
dpkg-deb --build --root-owner-group "${DEB_DIR}"
168+
169+
# Validate with lintian (non-fatal)
170+
sudo apt-get update -qq && sudo apt-get install -y -qq lintian > /dev/null 2>&1 || true
171+
lintian "${DEB_DIR}.deb" || true
172+
173+
mkdir -p release-artifacts
174+
mv "${DEB_DIR}.deb" "release-artifacts/${PKG}_${VERSION}_all.deb"
175+
176+
- name: Upload .deb artifact
177+
uses: actions/upload-artifact@v4
178+
with:
179+
name: mona-sans-deb-v${{ steps.version.outputs.version }}
180+
path: release-artifacts/*.deb
181+
182+
release:
183+
runs-on: ubuntu-latest
184+
needs: [build, build-deb]
185+
186+
steps:
187+
- name: Download zip artifacts
188+
uses: actions/download-artifact@v4
189+
with:
190+
name: mona-sans-release-zips-v${{ needs.build.outputs.version }}
191+
path: release-artifacts/
192+
193+
- name: Download .deb artifact
194+
uses: actions/download-artifact@v4
195+
with:
196+
name: mona-sans-deb-v${{ needs.build.outputs.version }}
197+
path: release-artifacts/
198+
78199
- name: Create release notes
79-
id: release_notes
80200
run: |
81201
cat > release_notes.md << 'EOF'
82-
# Mona Sans ${{ steps.version.outputs.tag }}
202+
# Mona Sans ${{ needs.build.outputs.tag }}
83203
84204
A versatile typeface, designed by GitHub together with Degarism and inspired by industrial-era grotesques. Mona Sans works well across product, web, and print.
85205
86206
## Font Packages
87-
207+
88208
- **Static Fonts** - Individual OTF and TTF files for each weight, width, and style
89209
- **Variable Fonts** - Modern variable font files with adjustable weight and width
90210
- **Web Fonts** - WOFF/WOFF2 files optimized for web use
91211
- **Complete Package** - All font formats in one download
92-
212+
- **Debian Package** - `.deb` package for Ubuntu 24.04 LTS (includes Mona Sans and Mona Sans Mono)
213+
93214
See the [README](https://github.com/github/mona-sans#readme) for detailed installation instructions.
94-
215+
95216
## Font Specifications
96-
217+
97218
- **Weight Range**: 200-900 (ExtraLight to Black)
98219
- **Width Range**: 75-125 (Condensed to Expanded)
99220
- **Styles**: Roman and Italic
100221
- **Format Support**: OTF, TTF, Variable TTF, WOFF, WOFF2
101222
EOF
102-
103-
- name: Create draft release with assets
223+
224+
- name: Create draft release with all assets
104225
uses: softprops/action-gh-release@v2
105226
with:
106-
tag_name: ${{ steps.version.outputs.tag }}
107-
name: Mona Sans ${{ steps.version.outputs.tag }}
227+
tag_name: ${{ needs.build.outputs.tag }}
228+
name: Mona Sans ${{ needs.build.outputs.tag }}
108229
body_path: release_notes.md
109230
draft: true
110231
prerelease: false
111-
files: |
112-
release-artifacts/mona-sans-static-v${{ steps.version.outputs.version }}.zip
113-
release-artifacts/mona-sans-variable-v${{ steps.version.outputs.version }}.zip
114-
release-artifacts/mona-sans-webfonts-v${{ steps.version.outputs.version }}.zip
115-
release-artifacts/mona-sans-complete-v${{ steps.version.outputs.version }}.zip
116-
117-
- name: Upload build artifacts
118-
uses: actions/upload-artifact@v4
119-
with:
120-
name: mona-sans-fonts-v${{ steps.version.outputs.version }}
121-
path: fonts/
122-
232+
files: release-artifacts/*
233+
123234
- name: Summary
124235
run: |
125236
echo "## Release Summary" >> $GITHUB_STEP_SUMMARY
126-
echo "Created draft release: **Mona Sans ${{ steps.version.outputs.tag }}**" >> $GITHUB_STEP_SUMMARY
237+
echo "Created draft release: **Mona Sans ${{ needs.build.outputs.tag }}**" >> $GITHUB_STEP_SUMMARY
127238
echo "" >> $GITHUB_STEP_SUMMARY
128239
echo "### Uploaded Assets:" >> $GITHUB_STEP_SUMMARY
129-
find release-artifacts -maxdepth 1 -name '*.zip' -print0 | while IFS= read -r -d '' file; do
240+
find release-artifacts -maxdepth 1 -type f -print0 | while IFS= read -r -d '' file; do
130241
filename=$(basename "$file")
131242
size=$(stat -c %s "$file")
132-
# Convert size in bytes to human-readable format
133243
hr_size=$(numfmt --to=iec-i --suffix=B "$size")
134244
echo "- $filename ($hr_size)" >> $GITHUB_STEP_SUMMARY
135245
done
136246
echo "" >> $GITHUB_STEP_SUMMARY
137-
echo "🔗 **[View Draft Release](https://github.com/${{ github.repository }}/releases/tag/${{ steps.version.outputs.tag }})**" >> $GITHUB_STEP_SUMMARY
247+
echo "🔗 **[View Draft Release](https://github.com/${{ github.repository }}/releases/tag/${{ needs.build.outputs.tag }})**" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)