fix(configuration): setup semantic versioning for pushes to the master or beta branches
This commit is contained in:
@@ -2,7 +2,11 @@ name: build_publish
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- src/**
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -52,7 +56,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: build
|
name: build
|
||||||
path: ./dist
|
path: ./dist
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -66,12 +69,15 @@ jobs:
|
|||||||
registry-url: https://registry.npmjs.org/
|
registry-url: https://registry.npmjs.org/
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
- name: Download a build artifact
|
- name: Install semantic-release extra plugins
|
||||||
|
run: npm install --save-dev @semantic-release/changelog @semantic-release/git
|
||||||
|
- name: Download build artifact
|
||||||
uses: actions/download-artifact@v3.0.2
|
uses: actions/download-artifact@v3.0.2
|
||||||
with:
|
with:
|
||||||
name: build
|
name: build
|
||||||
path: ./dist
|
path: ./dist
|
||||||
- name: Publish to npm registry
|
- name: Publish to npm registry
|
||||||
run: npm publish
|
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.ACTIONS_PAT }}
|
||||||
|
run: npx semantic-release
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"branches": [
|
||||||
|
"main",
|
||||||
|
{
|
||||||
|
"name": "beta",
|
||||||
|
"prerelease": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
|
"@semantic-release/commit-analyzer",
|
||||||
|
"@semantic-release/release-notes-generator",
|
||||||
|
[
|
||||||
|
"@semantic-release/changelog",
|
||||||
|
{
|
||||||
|
"changelogFile": "CHANGELOG.md"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@semantic-release/npm",
|
||||||
|
"@semantic-release/github",
|
||||||
|
[
|
||||||
|
"@semantic-release/git",
|
||||||
|
{
|
||||||
|
"assets": [
|
||||||
|
"CHANGELOG.md",
|
||||||
|
"dist/**",
|
||||||
|
"package.json",
|
||||||
|
"README.md",
|
||||||
|
"License.txt"
|
||||||
|
],
|
||||||
|
"message": "chore(release): set `package.json` to ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "onspring-api-sdk",
|
"name": "onspring-api-sdk",
|
||||||
"version": "0.0.3",
|
"version": "0.0.0-semantic-release",
|
||||||
"description": "A javascript SDK for interacting with version 2 of the Onspring API.",
|
"description": "A javascript SDK for interacting with version 2 of the Onspring API.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"onspring",
|
"onspring",
|
||||||
|
|||||||
Reference in New Issue
Block a user