Skip to content

Commit

Permalink
Merge pull request #249 from silinternational/feature/split-release
Browse files Browse the repository at this point in the history
split release into 2 steps
  • Loading branch information
hobbitronics authored Mar 20, 2024
2 parents 9350f66 + 7b2e12a commit 277539d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 5 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/npm-dry-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
push:
branches-ignore: main

jobs:
dry-run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm ci
- run: npm test
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
dry-run: true
19 changes: 19 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on:
pull_request:
types: [closed]
branches: main

jobs:
publish:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm ci
- run: npm test
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release
on:
push:
branches:
- main
- develop
jobs:
release:
name: Release
Expand All @@ -19,5 +19,4 @@ jobs:
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
12 changes: 9 additions & 3 deletions release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), enforced with [semantic-release](https://github.com/semantic-release/semantic-release).`

const plugins = [
[
'@semantic-release/npm',

{
npmPublish: false,
},
],
[
'@semantic-release/commit-analyzer',
{
Expand Down Expand Up @@ -150,13 +157,12 @@ function getCIConfig() {
// contains your normal semantic-release config
// this will be used on your CI environment
return {
branches: ['main'],
branches: ['develop'],
plugins: [
...plugins,
['@semantic-release/changelog', { changelogTitle: CHANGELOG_HEADER }],
'@semantic-release/npm',
'@semantic-release/git',
'@semantic-release/github',
['@semantic-release/github', { draft: true }],
],
}
}
Expand Down

0 comments on commit 277539d

Please sign in to comment.