Skip to content

Commit

Permalink
ci: add semantic-release to publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrc committed Mar 4, 2024
1 parent 2a72e25 commit ca54163
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,40 @@ name: Publish
on:
release:
types: [published]
workflow_dispatch:
push:
branches: [add-semantic-release]

jobs:
build:
name: Build and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-node@v4
with:
node-version: 18.x

- name: Install semantic-release extra plugins
run: npm install --save-dev @semantic-release/changelog @semantic-release/git

- name: Install
run: yarn

- name: Build
run: yarn build

# - name: Publish
# uses: JS-DevTools/npm-publish@v3
# with:
# token: ${{ secrets.CERN_SIS_NPM }}

- name: Publish
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.CERN_SIS_NPM }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.CERN_SIS_NPM }}
run: npx semantic-release
17 changes: 17 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export default {
branches: [{ name: "add-semantic-release", prerelease: "beta" }],
plugins: [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",

[
"@semantic-release/git",
{
assets: ["package.json", "CHANGELOG.md"],
message:
"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}",
},
],
],
};

0 comments on commit ca54163

Please sign in to comment.