Skip to content

Commit

Permalink
feat: release and publish tokens via gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
axamei committed May 9, 2022
1 parent f91ddad commit ba9141f
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release-and-publish-tokens.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release and publish tokens
on:
push:
branches: [main, beta]
jobs:
release:
name: Create package for release
runs-on: ubuntu-latest
steps:
# Check out repository
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
# Setup node.js for workflow
- name: Setup Node.js
uses: actions/setup-node@v2
# Installs dependencies
- name: Install dependencies
run: npm ci
# Installs semantic release for fully automated version management and package publishing
- name: Install semantic-release extra plugins
run: npm install --save-dev @semantic-release/changelog @semantic-release/git
# Runs semantic release
- name: Release and publish package
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
28 changes: 28 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
branches: [
'main',
{
name: 'beta',
prerelease: true
}
],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
[
'@semantic-release/changelog',
{
changelogFile: 'CHANGELOG.md'
}
],
'@semantic-release/npm',
'@semantic-release/github',
[
'@semantic-release/git',
{
assets: ['CHANGELOG.md', 'scss/**', 'assets/**'],
message: 'chore(release): set `package.json` to ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
}
]
]
}

0 comments on commit ba9141f

Please sign in to comment.