Skip to content

Commit fb5b69e

Browse files
committed
chore: Update npm dependencies and GitHub Actions workflow for publishing to npm and creating GitHub releases
1 parent 25d6b91 commit fb5b69e

2 files changed

Lines changed: 55 additions & 15 deletions

File tree

.github/workflows/publish.yml

Lines changed: 54 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,58 @@
11
name: Publish to npm and create GitHub Release
22

33
on:
4-
push:
5-
branches: master
6-
4+
push:
5+
branches: master
6+
77
jobs:
8-
publish:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/checkout@v4
12-
- uses: actions/setup-node@v3
13-
with:
14-
node-version: "20"
15-
- run: npm ci
16-
- uses: JS-DevTools/npm-publish@v3
17-
with:
18-
token: ${{ secrets.NPM_TOKEN }}
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: "20"
19+
registry-url: 'https://registry.npmjs.org'
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Publish to npm
25+
uses: JS-DevTools/npm-publish@v3
26+
with:
27+
token: ${{ secrets.NPM_TOKEN }}
28+
29+
- name: Configure .npmrc for GitHub Packages
30+
run: |
31+
echo "//npm.pkg.github.com/:_authToken=\${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
32+
echo "@${{ secrets.GITHUB_USERNAME }}:registry=https://npm.pkg.github.com" >> ~/.npmrc
33+
34+
- name: Publish to GitHub Packages
35+
run: npm publish
36+
env:
37+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Create GitHub Release
40+
id: create_release
41+
uses: actions/create-release@v1
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
with:
45+
tag_name: v${{ github.event.head_commit.timestamp }}
46+
release_name: Release v${{ github.event.head_commit.timestamp }}
47+
draft: false
48+
prerelease: false
49+
50+
- name: Upload Release Asset
51+
uses: actions/upload-release-asset@v1
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
with:
55+
upload_url: ${{ steps.create_release.outputs.upload_url }}
56+
asset_path: ./path-to-your-asset.zip
57+
asset_name: your-asset.zip
58+
asset_content_type: application/zip

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "modulatecss",
3-
"version": "1.0.27",
3+
"version": "1.0.28",
44
"description": "...",
55
"main": "dist/css/modulate.min.css",
66
"style": "dist/css/modulate.min.css",

0 commit comments

Comments
 (0)