Skip to content

Commit

Permalink
chore(ci): introduce semantic release (#241)
Browse files Browse the repository at this point in the history
semantic-release will evaluate the commits since the last version. If a new version is necessary, it will update the changelog, increase the version number (if necessary), create a git tag and publish a release on npm.
It will be triggered every time something gets pushed to master.

Fixes #54 
Fixes #32
  • Loading branch information
connium authored Apr 22, 2020
1 parent 3c1314a commit 304ba60
Show file tree
Hide file tree
Showing 6 changed files with 5,626 additions and 42 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,31 @@ on: [push]

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x]

name: Build and Test

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
- name: Install dependencies
run: npm ci
- name: Test
run: npm test
env:
CI: true
- name: Collect test coverage
if: matrix.node-version == '10.x'
run: npm run test:coverage
env:
CI: true
- name: Upload test coverage
if: matrix.node-version == '10.x'
uses: codecov/[email protected]
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release

on:
push:
branches:
- master

jobs:
release:
name: Release
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: Install dependencies
run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
9 changes: 9 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/github"
]
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

simple-odf is a library for creating Open Document Format text files using Typescript/JavaScript and Node.js.

[![Build Status](https://travis-ci.com/connium/simple-odf.svg?branch=master)](https://travis-ci.com/connium/simple-odf)
![](https://github.com/actions/connium/simple-odf/Continuous%20Integration/badge.svg)
[![Version](https://img.shields.io/npm/v/simple-odf.svg)](https://www.npmjs.com/package/simple-odf)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
![Continuous Integration](https://github.com/connium/simple-odf/workflows/Continuous%20Integration/badge.svg)
[![codecov](https://codecov.io/gh/connium/simple-odf/branch/master/graph/badge.svg)](https://codecov.io/gh/connium/simple-odf)
[![Dependencies](https://david-dm.org/connium/simple-odf.svg)](https://david-dm.org/connium/simple-odf)
[![Known Vulnerabilities](https://snyk.io/test/github/connium/simple-odf/badge.svg)](https://snyk.io/test/github/connium/simple-odf)
Expand Down
Loading

0 comments on commit 304ba60

Please sign in to comment.