Skip to content

Commit

Permalink
Merge pull request #909 from standard/cd
Browse files Browse the repository at this point in the history
ci: continuous delivery
  • Loading branch information
rostislav-simonik authored Aug 9, 2022
2 parents 9b205a8 + 971c680 commit b8eb5b5
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@ on:
push: {}

jobs:
publish:
needs: ci
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: navikt/github-app-token-generator@v1
id: get-token
with:
app-id: ${{ secrets.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- uses: actions/checkout@v3
with:
persist-credentials: false # for later steps to use a different authentication
- run: npm install
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ steps.get-token.outputs.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# The ci-matrix job ends up as multiple jobs and therefore as multiple checks.
# Each check's name ends up with the node version appended.
# If we were to use those checks as required checks, we would have to occasionally bump them.
Expand Down
44 changes: 44 additions & 0 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
branches:
- master
plugins:
- - "@semantic-release/commit-analyzer"
- releaseRules:
- breaking: true
release: major
- revert: true
release: patch
- type: feat
release: minor
- type: fix
release: patch
- type: perf
release: patch
- type: docs
release: patch
- - "@semantic-release/release-notes-generator"
- preset: conventionalcommits
presetConfig:
types:
- type: build
section: Build system / dependencies
- type: ci
section: CI
- type: docs
section: Documentation
- type: feat
section: Features
- type: fix
section: Bug fixes
- type: perf
section: Performance
- type: refactor
section: Refactoring
- type: test
section: Testing
- "@semantic-release/changelog"
- "@semantic-release/github"
- "@semantic-release/npm"
- - "@semantic-release/git"
- assets:
- CHANGELOG.md
- package.json
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
"@arkweid/lefthook": "0.7.7",
"@commitlint/cli": "17.0.3",
"@commitlint/config-conventional": "17.0.3",
"@semantic-release/changelog": "6.0.1",
"@semantic-release/git": "10.0.1",
"@types/eslint": "8.4.5",
"@types/js-yaml": "4.0.5",
"@types/node": "18.6.5",
Expand All @@ -86,6 +88,7 @@
"npm-run-all": "4.1.5",
"read-pkg-up": "8.0.0",
"runtypes": "6.5.1",
"semantic-release": "19.0.3",
"semver": "7.3.7",
"standard-version": "9.5.0",
"tsconfigs": "5.0.0",
Expand Down

0 comments on commit b8eb5b5

Please sign in to comment.