Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): Automated release using semantic-release. #1503

Merged
merged 4 commits into from
Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release
on:
push:
branches: [main, development]

jobs:
release:
name: Release
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install dependencies
run: npm install @semantic-release/changelog @semantic-release/git @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/exec @semantic-release/git semantic-release/release-notes-generator
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
45 changes: 45 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"branches": ["+([0-9])?(.{+([0-9]),x}).x", "main", "next"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md",
"changelogTitle": "# Semantic Versioning Changelog"
}
],
[
"@semantic-release/npm",
{
"npmPublish": false,
"tarballDir": "dist"
}
],
[
"@semantic-release/exec",
{
"prepareCmd": "./prepare-release.sh ${nextRelease.version}"
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md"
]
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "dist/**"
}
]
}
]
]
}
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "gossamer",
"version": "1.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this need to correspond to our actual current release version or no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. I think this is the version to be published in the npm repo. But the tool automatically figures out the version number based on the previous release.

"description": "<div align=\"center\"> <img alt=\"Gossamer logo\" src=\"/docs/assets/img/gossamer_banner.png\" width=\"600\" /> </div> <div align=\"center\"> <a href=\"https://www.gnu.org/licenses/gpl-3.0\"> <img alt=\"License: GPL v3\" src=\"https://img.shields.io/badge/License-GPLv3-blue.svg?style=for-the-badge&label=License\" height=\"20\"/> </a> <a href=\"https://github.com/ChainSafe/gossamer/actions\"> <img alt=\"build status\" src=\"https://img.shields.io/github/workflow/status/ChainSafe/gossamer/build?branch=development&style=for-the-badge&logo=github&label=build\" height=\"20\"/> </a> <a href=\"https://godoc.org/github.com/ChainSafe/gossamer\"> <img alt=\"go doc\" src=\"http://img.shields.io/badge/godoc-reference-5272B4.svg?style=for-the-badge\" height=\"20\" /> </a> <a href=\"https://goreportcard.com/report/github.com/ChainSafe/gossamer\"> <img alt=\"go report card\" src=\"https://goreportcard.com/badge/github.com/ChainSafe/gossamer?style=for-the-badge\" height=\"20\" /> </a> </div> <div align=\"center\"> <a href=\"https://app.codecov.io/gh/ChainSafe/gossamer\"> <img alt=\"Test Coverage\" src=\"https://img.shields.io/codecov/c/github/ChainSafe/gossamer/development?style=for-the-badge\" height=\"20\" /> </a> <a href=\"https://discord.gg/zy8eRF7FG2\"> <img alt=\"Discord\" src=\"https://img.shields.io/discord/593655374469660673.svg?style=for-the-badge&label=Discord&logo=discord\" height=\"20\"/> </a> <a href=\"https://medium.com/chainsafe-systems/tagged/polkadot\"> <img alt=\"Gossamer Blog\" src=\"https://img.shields.io/badge/Medium-grey?style=for-the-badge&logo=medium\" height=\"20\" /> </a> <a href=\"https://medium.com/chainsafe-systems/tagged/polkadot\"> <img alt=\"Twitter\" src=\"https://img.shields.io/twitter/follow/chainsafeth?color=blue&label=follow&logo=twitter&style=for-the-badge\" height=\"20\"/> </a> </div> <br />",
"main": "index.js",
"publishConfig": {
"access": "public"
},
"release": {
"branches": [
"development",
"next"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/ChainSafe/gossamer.git"
},
"bugs": {
"url": "https://github.com/ChainSafe/gossamer/issues"
},
"homepage": "https://github.com/ChainSafe/gossamer"
}