Skip to content

πŸ”€ v2.0.0

πŸ”€ v2.0.0 #86

name: 'Publish NPM Package'
on:
push:
tags-ignore: ['*']
pull_request:
permissions:
contents: 'read'
jobs:
build:
runs-on: 'ubuntu-latest'
steps:
- name: 'Setup node πŸ›ŽοΈ'
uses: 'dudeofawesome/actions/node-setup@v1'
- name: 'Build πŸ—οΈ'
run: 'npm run build'
lint:
runs-on: 'ubuntu-latest'
steps:
- name: 'Setup node πŸ›ŽοΈ'
uses: 'dudeofawesome/actions/node-setup@v1'
- name: 'Lint πŸ§ͺ'
run: 'npm run lint'
test:
runs-on: 'ubuntu-latest'
steps:
- name: 'Setup node πŸ›ŽοΈ'
uses: 'dudeofawesome/actions/node-setup@v1'
- name: 'Test πŸ§ͺ'
run: 'npm run test'
publish:
runs-on: 'ubuntu-latest'
environment: 'production'
permissions:
id-token: 'write'
packages: 'write'
contents: 'write'
needs:
- 'build'
- 'lint'
- 'test'
steps:
- name: 'Setup node πŸ›ŽοΈ'
uses: 'dudeofawesome/actions/node-setup@v1'
- name: 'Publish to NPM πŸš€'
env:
NODE_AUTH_TOKEN: '${{ secrets.NPM_AUTH_TOKEN }}'
uses: 'dudeofawesome/actions/npm-publish@v1'
- name: 'Get package version πŸ”–'
id: 'get-package-version'
run: 'echo "version=v$(npm pkg get version | jq --raw-output)" >> "$GITHUB_OUTPUT"'
- name: 'Build jsonschema πŸ—οΈ'
run: 'npm run build:jsonschema --workspace packages/code-style'
- name: 'πŸ”Š'
run: 'ls -lha packages/code-style/codestylerc.schema.json'
- name: 'Publish files to Github Releases πŸš€'
uses: 'softprops/action-gh-release@v1'
with:
tag_name: '${{ steps.get-package-version.outputs.version }}'
prerelease: "${{ contains(steps.get-package-version.outputs.version, '-') }}"
files: |
packages/code-style/codestylerc.schema.json