Skip to content

Commit

Permalink
Add publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
baileyherbert committed Jan 3, 2022
1 parent 17986ce commit 2bc0119
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 4 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: publish

on:
release:
types:
- published
workflow_dispatch:

jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm run build
- id: get_version
uses: battila7/get-version-action@v2
- run: npm --no-git-tag-version version ${{ steps.get_version.outputs.version-without-v }}

# First release is manual
- if: steps.get_version.outputs.version-without-v != '1.0.0'
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
29 changes: 27 additions & 2 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "envato",
"version": "3.0.4",
"version": "dev",
"description": "A fully typed library for the Envato API (unofficial).",
"license": "MIT",
"main": "dist/index.js",
Expand All @@ -9,7 +9,7 @@
"dist/**/*"
],
"scripts": {
"build": "tsc",
"build": "rimraf dist && tsc",
"test": "mocha --timeout 30000"
},
"repository": "github:baileyherbert/envato.js",
Expand All @@ -29,6 +29,7 @@
"devDependencies": {
"@types/mocha": "^5.2.7",
"mocha": "^9.1.3",
"rimraf": "^3.0.2",
"typescript": "^4.3.5"
}
}

0 comments on commit 2bc0119

Please sign in to comment.