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

Package publish workflow #756

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,57 @@
name: Kubernetes Javascript Client

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
validation:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '16', '14', '12' ]
name: Node ${{ matrix.node }} validation
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
# Pre-check to validate that versions match between package.json
# and package-lock.json. Needs to run before npm install
- run: node version-check.js
- run: npm ci
- run: npm test
- run: npm run lint
- run: npm audit --audit-level=critical
release-package:
name: Release Package
runs-on: ubuntu-latest
needs: validation
steps:
- name: Checkout
uses: actions/checkout@v2.3.1
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14.x'
# Pre-check to validate that versions match between package.json
# and package-lock.json. Needs to run before npm install
- name: Validate package.json and package-lock.json versions
run: node version-check.js
- name: Install dependencies
run: npm ci
- name: Publish package
id: publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
dry-run: github.event_name == 'pull_request'
- name: Check if version was already published
uses: actions/github-script@v5
with:
script: |
if(${{ steps.publish.outputs.type == 'none' }}) {
core.setFailed('Version ${{ steps.publish.outputs.old-version }} was already published')
}
28 changes: 0 additions & 28 deletions .github/workflows/test.yml

This file was deleted.