Skip to content

Commit

Permalink
Merge pull request #47 from OneSignal/automate-release
Browse files Browse the repository at this point in the history
build: automate release flow
  • Loading branch information
sherwinski authored Nov 20, 2024
2 parents e419c4d + 245a810 commit 1213cb9
Show file tree
Hide file tree
Showing 2 changed files with 174 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release
on:
push:
branches:
- main

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npx -p semantic-release \
-p @semantic-release/changelog \
-p @semantic-release/git \
-p @semantic-release/github \
-p @semantic-release/npm \
-p conventional-changelog-conventionalcommits \
semantic-release --dry-run
136 changes: 136 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
{
"branches": [
"main"
],
"tagFormat": "${version}",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"releaseRules": [
{
"breaking": true,
"release": "minor"
},
{
"type": "feat",
"release": "minor"
},
{
"type": "fix",
"release": "patch"
},
{
"type": "docs",
"release": "patch"
},
{
"type": "perf",
"release": "patch"
},
{
"type": "refactor",
"release": "patch"
},
{
"type": "style",
"release": "patch"
},
{
"type": "test",
"release": "patch"
},
{
"type": "build",
"release": "patch"
},
{
"type": "ci",
"release": "patch"
},
{
"type": "chore",
"scope": "deps",
"release": "patch"
}
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"writerOpts": {
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "docs",
"section": "Documentation",
"hidden": false
},
{
"type": "deps",
"section": "Dependency Updates",
"hidden": false
},
{
"type": "chore",
"hidden": true
},
{
"type": "style",
"hidden": true
},
{
"type": "refactor",
"hidden": true
},
{
"type": "perf",
"hidden": true
},
{
"type": "test",
"hidden": true
}
]
}
}
],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md",
"changelogTitle": "# Changelog"
}
],
[
"@semantic-release/npm",
{
"pkgRoot": "."
}
],
[
"@semantic-release/git",
{
"assets": [
"bundles/**",
"esm2015/**",
"fesm2015/**",
"lib/**",
"package.json",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes} [skip ci]"
}
],
"@semantic-release/github"
]
}

0 comments on commit 1213cb9

Please sign in to comment.