Skip to content

Commit

Permalink
chore: automatic release (#4)
Browse files Browse the repository at this point in the history
* remove lockfile

* ignore lockfile

* add automatic release
  • Loading branch information
mpetrunic authored Apr 15, 2022
1 parent 0ce33da commit 2051ada
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 2,910 deletions.
8 changes: 8 additions & 0 deletions .github/.dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "yarn"
allow:
# Allow both direct and indirect updates for all packages
- dependency-type: "production"
commit-message:
prefix: "chore: "
49 changes: 43 additions & 6 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node.js CI
name: Node.js CI/CD

on:
push:
Expand All @@ -7,7 +7,7 @@ on:
branches: [ master ]

jobs:
build:
test:

runs-on: ubuntu-latest

Expand All @@ -16,13 +16,50 @@ jobs:
node-version: [10.x, 12.x, 14.x, 15.x]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: sudo apt-get update -qq
- run: sudo apt-get install libsnappy-dev
- run: sudo pip install python-snappy
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: yarn --frozen-lockfile
- run: yarn test
- run: yarn
- run: yarn test

maybe-release:
name: release
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
# you should probably do this after your regular CI checks passes
- uses: google-github-actions/release-please-action@v3 # it will analyze commits and create PR with new version and updated CHANGELOG:md file. On merging it will create github release page with changelog
id: release
with:
release-type: node
package-name: release-please-action
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false}]'

- uses: actions/checkout@v3
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.release_created }}

- uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version: 16
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}

- run: yarn install --ignore-scripts
if: ${{ steps.release.outputs.release_created }}

- run: yarn build
if: ${{ steps.release.outputs.release_created }}

- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} # use npm "Automation" token and put in Github repository secrets under "NPM_TOKEN"
if: ${{ steps.release.outputs.release_created }}
24 changes: 24 additions & 0 deletions .github/workflows/semantic-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Semantic PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
fix
feat
chore
validateSingleCommit: true

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.idea
yarn.lock
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
"stream",
"framing"
],
"author": "David Björklund <[email protected]>",
"contributors": [
"David Björklund <[email protected]>",
"ChainSafe <[email protected]>"
],
"license": "MIT",
"devDependencies": {
"async-benchmark": "^1.0.0",
Expand All @@ -30,10 +33,10 @@
},
"repository": {
"type": "git",
"url": "https://github.com/kesla/node-snappy-stream.git"
"url": "https://github.com/chainsafe/node-snappy-stream.git"
},
"bugs": {
"url": "https://github.com/kesla/node-snappy-stream/issues"
"url": "https://github.com/chainsafe/node-snappy-stream/issues"
},
"homepage": "https://github.com/kesla/node-snappy-stream"
"homepage": "https://github.com/chainsafe/node-snappy-stream"
}
Loading

0 comments on commit 2051ada

Please sign in to comment.