Skip to content

Commit dfe61c6

Browse files
authored
chore: add publish workflow (#138)
1 parent f4d05b7 commit dfe61c6

File tree

4 files changed

+52
-5
lines changed

4 files changed

+52
-5
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
fail-fast: false
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v4
1818
- name: Use Node v${{ matrix.node-version }}
19-
uses: actions/setup-node@v2
19+
uses: actions/setup-node@v4
2020
with:
2121
node-version: ${{ matrix.node-version }}
2222
- name: Install Dependencies

.github/workflows/publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish Release (npm)
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
- name: Setup Node
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: 20
17+
- name: Install Dependencies
18+
run: npm ci
19+
- name: Lint
20+
run: npm run lint
21+
- name: Test
22+
run: npm test
23+
24+
publish-npm:
25+
needs: build
26+
runs-on: ubuntu-latest
27+
permissions:
28+
id-token: write
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: actions/setup-node@v4
32+
with:
33+
node-version: 22.x
34+
registry-url: 'https://registry.npmjs.org'
35+
cache: 'npm'
36+
- run: npm ci
37+
- run: npm version ${TAG_NAME} --git-tag-version=false
38+
env:
39+
TAG_NAME: ${{ github.ref_name }}
40+
- run: npm publish --provenance --access public --tag next
41+
if: "github.event.release.prerelease"
42+
env:
43+
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
44+
- run: npm publish --provenance --access public
45+
if: "!github.event.release.prerelease"
46+
env:
47+
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-wc",
3-
"version": "2.1.0",
3+
"version": "0.0.0-dev",
44
"description": "ESLint plugin for Web Components",
55
"main": "lib/index.js",
66
"files": [

0 commit comments

Comments
 (0)