Skip to content

Commit

Permalink
ci: add semantic-release (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
xobotyi authored Jul 25, 2022
1 parent c52e21f commit 3941e01
Show file tree
Hide file tree
Showing 3 changed files with 2,418 additions and 49 deletions.
58 changes: 57 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,66 @@ jobs:
files: coverage/lcov.info
fail_ci_if_error: true

build:
name: "Build"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: 16

- uses: bahmutov/npm-install@v1
with:
useRollingCache: true
install-command: yarn --frozen-lockfile

- name: "Build"
run: yarn build

semantic-release:
name: "Release"
runs-on: ubuntu-latest
needs: [ "lint", "test", "build" ]
permissions:
pull-requests: write
contents: write
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
outputs:
new-release-published: ${{ steps.release.outputs.new-release-published }}
steps:
- name: "Checkout"
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: 16

- uses: bahmutov/npm-install@v1
with:
useRollingCache: true
install-command: yarn --frozen-lockfile

- name: "Build package"
run: yarn build

- name: "Release"
id: "release"
uses: codfish/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

dependabot-merge:
name: "Dependabot automerge"
runs-on: ubuntu-latest
needs: [ "test", "lint" ]
needs: [ "lint", "test", "build" ]
permissions:
pull-requests: write
contents: write
Expand Down
14 changes: 14 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
"@babel/preset-env": "^7.18.9",
"@jamesacarr/eslint-formatter-github-actions": "^0.1.0",
"@react-hookz/eslint-config": "^1.6.1",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^8.0.5",
"@types/jasmine": "^4.0.3",
"@types/karma": "^6.3.3",
"@types/react": "^17",
Expand All @@ -68,6 +71,7 @@
"rollup": "^2.77.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-typescript2": "^0.32.1",
"semantic-release": "^19.0.3",
"simulant": "^0.2.2",
"tslib": "^2.4.0",
"typescript": "^4.7.4"
Expand All @@ -81,5 +85,15 @@
"devserver": "cd ./testbench && npm i && npm run devserver",
"build": "rimraf ./dist && rollup --config",
"test": "cross-env NODE_ENV=production karma start"
},
"release": {
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/github"
]
}
}
Loading

0 comments on commit 3941e01

Please sign in to comment.