Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add publish workflow #138

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Use Node v${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish Release (npm)

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Test
run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.x
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- run: npm ci
- run: npm version ${TAG_NAME} --git-tag-version=false
env:
TAG_NAME: ${{ github.ref_name }}
- run: npm publish --provenance --access public --tag next
if: "github.event.release.prerelease"
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
- run: npm publish --provenance --access public
if: "!github.event.release.prerelease"
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-wc",
"version": "2.1.0",
"version": "0.0.0-dev",
"description": "ESLint plugin for Web Components",
"main": "lib/index.js",
"files": [
Expand Down
Loading