Skip to content

Commit

Permalink
ci: Setup automatic release
Browse files Browse the repository at this point in the history
  • Loading branch information
neet committed Mar 25, 2021
1 parent a8d35ae commit c928200
Show file tree
Hide file tree
Showing 6 changed files with 2,960 additions and 546 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
push:
branches:
- master
- main
pull_request:
branches:
- '*'
Expand All @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x]
node-version: [14]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
Expand Down
39 changes: 12 additions & 27 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,21 @@
name: Publish

on:
release:
types: [published]
schedule:
- cron: '0 0 * * *'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10]

env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
steps:
- uses: actions/checkout@v1

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Set npm token
run: npm config set "//registry.npmjs.org/:_authToken" $NPM_TOKEN
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish package with next tag when prereleased
if: github.event.release.prerelease
run: npm publish --tag next

- name: Publish package with latest tag when released
if: github.event.release.prerelease != true
run: npm publish
node-version: 14
- run: yarn install --frozen-lockfiles
- run: yarn test
- run: yarn build
- run: yarn run semantic-release
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//npm.pkg.github.com/:_authToken=${NPM_TOKEN}
11 changes: 11 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/github",
"@semantic-release/git"
]
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"devDependencies": {
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-json": "^4.1.0",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"@types/jest": "^26.0.20",
"@types/node": "^14.14.31",
"@types/semver": "^7.3.4",
Expand All @@ -52,7 +54,7 @@
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-typescript2": "^0.30.0",
"rxjs": "^6.6.6",
"standard-version": "^9.1.1",
"semantic-release": "^17.4.2",
"ts-jest": "^26.5.2",
"typedoc": "^0.20.28",
"typescript": "^4.2.3"
Expand Down

0 comments on commit c928200

Please sign in to comment.