Skip to content

Commit fc6a055

Browse files
committed
ci: fix release artifacts and optimize build workflows (#23)
* ci: restrict build workflow to PRs targeting main Only run build workflow when pull requests target the main branch, preventing unnecessary builds on feature branch pushes. * ci: update release trigger to semantic version pattern Change tag pattern to require v prefix (e.g., v1.0.0) following semantic versioning conventions. * fix: correct fonts directory path in release workflow Update release workflow to zip fonts from public/fonts directory where they were moved, fixing missing artifacts in releases. * ci: rename release artifact and add error handling - Rename fonts.zip to ServerMono-fonts.zip for clarity - Add artifactErrorsFailBuild to catch upload failures - Include individual font files as artifacts * ci: update GitHub Actions to latest versions Update checkout action from v3 to v4 to address actionlint warnings and ensure compatibility. * ci: use npm ci in build workflow Replace npm install with npm ci for faster, more reliable builds with reproducible dependency installation. * build: track package-lock.json for reproducible builds Enable npm ci in CI/CD workflows by committing package-lock.json. This ensures consistent dependency versions across environments and faster, more reliable builds.
1 parent 020f346 commit fc6a055

File tree

4 files changed

+2114
-10
lines changed

4 files changed

+2114
-10
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: Build
22

33
on:
4-
push:
4+
pull_request:
5+
branches:
6+
- main
57

68
jobs:
79
test:
@@ -12,15 +14,15 @@ jobs:
1214
repository-projects: write
1315
steps:
1416
- name: Checkout repository
15-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1618

1719
- name: Install Node.js
18-
uses: actions/setup-node@v3
20+
uses: actions/setup-node@v4
1921
with:
2022
node-version: 18
2123

2224
- name: Install dependencies
23-
run: npm install
25+
run: npm clean-install
2426
env:
2527
CI: true
2628

.github/workflows/release.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: Create a new GitHub release with the files
22

33
on:
44
push:
5-
tags: ['*']
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
67
workflow_dispatch:
78

89
jobs:
@@ -16,9 +17,12 @@ jobs:
1617
- name: Checkout repository
1718
uses: actions/checkout@v4
1819
- name: Create a ZIP archive from the fonts directory
19-
run: zip -r fonts.zip fonts
20-
- name: Create new release and upload fonts.zip
20+
run: zip -r ServerMono-fonts.zip public/fonts
21+
- name: Create new release and upload artifacts
2122
uses: ncipollo/release-action@v1
2223
with:
23-
artifacts: 'fonts.zip'
24+
artifacts: 'ServerMono-fonts.zip,public/fonts/*'
25+
artifactErrorsFailBuild: true
2426
generateReleaseNotes: true
27+
prerelease: false
28+
draft: false

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ yarn.lock
1212
node_modules
1313
dist
1414
analytics.txt
15-
package-lock.json
1615

1716
/**/*/.DS_STORE
1817
/**/*/node_modules
1918
/**/*/.next
20-
/**/*/.data
19+
/**/*/.data

0 commit comments

Comments
 (0)