Skip to content

Commit

Permalink
chore: add semantic release with Github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Matteo Padovano authored and mrbatista committed Apr 13, 2021
1 parent bd83410 commit 31fc800
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 3 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,29 @@ jobs:
with:
node-version: 14
- name: Bootstrap project
run: |
npm ci
run: npm ci
- name: Build project
run: npm run build
- name: Verify code linting
run: npm run lint

release:
name: Release
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
needs: [test, code-lint]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v2
- name: Bootstrap project
run: npm ci
- name: Build project
run: npm run build
- name: Publish package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
10 changes: 10 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"main",
"next",
"next-major",
{ "name": "beta", "prerelease": true },
{ "name": "alpha", "prerelease": true }
]
}
115 changes: 115 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": ">=10.16"
"node": ">=10.18"
},
"scripts": {
"build": "lb-tsc",
Expand Down Expand Up @@ -56,6 +56,7 @@
"@loopback/core": "^2.15.1",
"@loopback/eslint-config": "^10.1.1",
"@loopback/testlab": "^3.3.1",
"@semantic-release/git": "^9.0.0",
"@types/node": "^10.17.56",
"eslint": "^7.23.0",
"source-map-support": "^0.5.19",
Expand Down

0 comments on commit 31fc800

Please sign in to comment.