Skip to content

Commit

Permalink
ci: generate release notes automatically (estahn#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
estahn authored Sep 7, 2022
1 parent 98d138e commit cc453b4
Show file tree
Hide file tree
Showing 6 changed files with 10,590 additions and 10 deletions.
12 changes: 9 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@ updates:
directory: "/"
target-branch: "main"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "docker"
directory: "/"
target-branch: "main"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "gomod"
directory: "/"
target-branch: "main"
schedule:
interval: "daily"
interval: "weekly"

- package-ecosystem: "npm"
directory: "/"
target-branch: "main"
schedule:
interval: "weekly"
16 changes: 9 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ jobs:
runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/master'
steps:

- name: Setup Node.js for use with actions
uses: actions/setup-node@v3.4.1

- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.CR_PAT }}

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

- run: npm ci

- name: Unshallow
run: git fetch --prune --unshallow

Expand All @@ -30,8 +33,7 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v2

- name: Run semantic-release
run: npx -p @semantic-release/changelog@v5.0.1 -p semantic-release@17.3.0 -p @semantic-release/git@v9.0.1 semantic-release
- run: semantic-release
env:
GH_TOKEN: ${{ secrets.CR_PAT }}

Expand All @@ -56,6 +58,6 @@ jobs:
uses: goreleaser/goreleaser-action@v3.1.0
with:
version: latest
args: release --rm-dist
args: release --rm-dist --release-notes /tmp/release-notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ repos:
- id: check-json
- id: pretty-format-json
args: ['--autofix']
exclude: package-lock.json
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
Expand Down
23 changes: 23 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ plugins:
- "@semantic-release/changelog"
- "@semantic-release/github"
- "@semantic-release/git"
- - "@semantic-release/exec"
- generateNotesCmd: |
echo "${nextRelease.notes}" > /tmp/release-notes.md

branch: main
branches:
- '+([0-9])?(.{+([0-9]),x}).x'
Expand All @@ -25,3 +29,22 @@ analyzeCommits:
- type: "build"
scope: "deps"
release: "patch"

generateNotes:
- path: "@semantic-release/release-notes-generator"
preset: "conventionalcommits"
presetConfig:
types:
- { type: 'feat', section: ':tada: Features' }
- { type: 'feature', section: ':tada: Features' }
- { type: 'fix', section: ':bug: Bug Fixes' }
- { type: 'perf', section: ':zap: Performance Improvements' }
- { type: 'revert', section: ':rewind: Reverts' }
- { type: 'docs', section: ':memo: Documentation', hidden: false }
- { type: 'style', section: 'Styles', hidden: true }
- { type: 'chore', section: 'Miscellaneous Chores', hidden: true }
- { type: 'refactor', section: 'Code Refactoring', hidden: true }
- { type: 'test', section: ':test_tube: Tests', hidden: true }
- { type: 'build', scope: 'deps', section: ':arrow_up: Dependencies' }
- { type: 'build', section: ':construction_worker: Build System' }
- { type: 'ci', section: 'Continuous Integration', hidden: true }
Loading

0 comments on commit cc453b4

Please sign in to comment.