Skip to content

Commit

Permalink
add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrunic committed Aug 2, 2022
1 parent 8d96531 commit 6a0e15d
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 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: "
22 changes: 22 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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
53 changes: 53 additions & 0 deletions .github/workflows/test_maybe_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Test and Maybe Release
on:
push:
branches:
- master
pull_request:
branches:
- "**"
jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3

- run: yarn install --frozen-lockfile

- run: yarn run test

maybe-release:
name: release
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: ['test']
steps:
- 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 --frozen-lockfile
if: ${{ steps.release.outputs.release_created }}

- run: npm 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 }}

0 comments on commit 6a0e15d

Please sign in to comment.