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

feat: ci for publishing #12

Merged
merged 8 commits into from
Oct 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release

on:
workflow_dispatch:

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: 12.x
- name: Install dependencies
run: yarn
- name: Install semantic-release extra plugins
run: yarn add -D @semantic-release/changelog @semantic-release/git
- name: Test
run: yarn test
- name: Build
run: yarn build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
11 changes: 11 additions & 0 deletions CONTRIBUTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# How to Contribute

## Pull Requests

1. Fork the Metaplex JS repository
2. Create a new branch for each feature, fix or improvement
3. Send a pull request from each feature branch to the **master** branch
zaxozhu marked this conversation as resolved.
Show resolved Hide resolved

## Style Guide

All pull requests SHOULD adhere to the [Conventional Commits specification](https://conventionalcommits.org/)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ await Metaplex.initStore(wallet.publicKey);
```ts
import { Coingecko, Currency } from "@metaplex/js";
const rates = await new Coingecko().getRate([Currency.AR, Currency.SOL], Currency.USD);
```
```
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
};
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,21 @@
"example:iife": "yarn workspace example-iife run start",
"example:node": "yarn workspace example-node run start",
"clean": "yarn cache clean && rm -rf node_modules",
"preinstall": "npx only-allow yarn"
"preinstall": "npx only-allow yarn",
"prepare": "husky install"
},
"devDependencies": {
"@commitlint/cli": "^13.2.0",
"@commitlint/config-conventional": "^13.2.0",
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.30.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.2",
"prettier": "^2.3.2",
"rimraf": "^3.0.2",
"semantic-release": "^18.0.0",
"typescript": "^4.4.3"
},
"commitlint": {
Expand Down
29 changes: 29 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = {
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/**'],
message:
'chore(release): set `package.json` to ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
},
],
],
};
Loading