Skip to content

Commit 6a0e15d

Browse files
committed
add ci
1 parent 8d96531 commit 6a0e15d

File tree

3 files changed

+83
-0
lines changed

3 files changed

+83
-0
lines changed

.github/.dependabot.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "yarn"
4+
allow:
5+
# Allow both direct and indirect updates for all packages
6+
- dependency-type: "production"
7+
commit-message:
8+
prefix: "chore: "

.github/workflows/pr.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Semantic PR"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
name: Validate PR title
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: amannn/action-semantic-pull-request@v4
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
with:
19+
types: |
20+
fix
21+
feat
22+
chore
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Test and Maybe Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- "**"
9+
jobs:
10+
test:
11+
name: test
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- uses: actions/setup-node@v3
17+
18+
- run: yarn install --frozen-lockfile
19+
20+
- run: yarn run test
21+
22+
maybe-release:
23+
name: release
24+
runs-on: ubuntu-latest
25+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
26+
needs: ['test']
27+
steps:
28+
- 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
29+
id: release
30+
with:
31+
release-type: node
32+
package-name: release-please-action
33+
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false}]'
34+
35+
- uses: actions/checkout@v3
36+
# these if statements ensure that a publication only occurs when
37+
# a new release is created:
38+
if: ${{ steps.release.outputs.release_created }}
39+
40+
- uses: actions/setup-node@v3
41+
with:
42+
cache: "yarn"
43+
node-version: 16
44+
registry-url: "https://registry.npmjs.org"
45+
if: ${{ steps.release.outputs.release_created }}
46+
47+
- run: yarn install --frozen-lockfile
48+
if: ${{ steps.release.outputs.release_created }}
49+
50+
- run: npm publish
51+
env:
52+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} # use npm "Automation" token and put in Github repository secrets under "NPM_TOKEN"
53+
if: ${{ steps.release.outputs.release_created }}

0 commit comments

Comments
 (0)