Skip to content

Commit

Permalink
ci: add GitHub Action to automate npm publish (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Enda authored Aug 6, 2021
1 parent ecb823c commit 8c138b6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/release-spectral.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Releas @rhoas/spectral-ruleset
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org'
- name: Change to spectral directory
run: cd spectral
- run: npm install
- name: Set version
run: npm version ${{ github.event.release.tag_name }}
- run: npm publish dist --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.RHOAS_NPM_TOKEN }}
4 changes: 2 additions & 2 deletions spectral/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rhoas/spectral-ruleset",
"version": "0.1.2",
"version": "0.0.0",
"description": "Spectral ruleset",
"private": false,
"main": "ruleset.yaml",
Expand Down Expand Up @@ -44,4 +44,4 @@
"url": "https://github.com/redhat-developer/app-services-api-guidelines/issues"
},
"homepage": "https://github.com/redhat-developer/app-services-api-guidelines#readme"
}
}

0 comments on commit 8c138b6

Please sign in to comment.