Skip to content

Commit

Permalink
Feature: Automate Publishing to NPM
Browse files Browse the repository at this point in the history
Automate Npm Publish
  • Loading branch information
puskuruk committed Jul 12, 2020
2 parents 5f9de9a + c88bd8b commit 2991454
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,32 @@
name: Release
on:
push:
branches:
- master
jobs:
release:
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: Release
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 13
- name: Install dependencies
run: npm install
- name: Build NPM package
run: npm run build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
- name: Publish github pages
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/UniversalDataTool/udt-labelme-converter.git
npm run gh-pages -- -u "github-actions-bot <support+actions@github.com>"
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .releaserc.js
@@ -0,0 +1,17 @@
module.exports = {
branch: "master",
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/npm", { npmPublish: true, pkgRoot: "." }],
"@semantic-release/github",
[
"@semantic-release/git",
{
assets: ["package.json"],
message:
"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
},
],
],
}
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -16,6 +16,7 @@
"yargs": "^15.3.1"
},
"devDependencies": {
"@semantic-release/git": "^9.0.0",
"ava": "^3.9.0",
"rimraf": "^3.0.2"
},
Expand Down

0 comments on commit 2991454

Please sign in to comment.