Skip to content

Commit 21b6092

Browse files
authored
Merge pull request #232 from nicolethoen/update_github_actions_for_prerelease
feat(release.yml): Dry run publish prerelease using github actions
2 parents 9a28433 + a7aef73 commit 21b6092

File tree

3 files changed

+56
-49
lines changed

3 files changed

+56
-49
lines changed

.github/workflows/npm-publish.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
env:
10+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
11+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v1
15+
with:
16+
node-version: 16
17+
- uses: actions/cache@v2
18+
id: yarn-cache
19+
name: Cache npm deps
20+
with:
21+
path: |
22+
node_modules
23+
**/node_modules
24+
~/.cache/Cypress
25+
key: ${{ runner.os }}-yarn-16-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
26+
- run: yarn install --frozen-lockfile
27+
if: steps.yarn-cache.outputs.cache-hit != 'true'
28+
- uses: actions/cache@v2
29+
id: dist
30+
name: Cache dist
31+
with:
32+
path: |
33+
packages/*/dist
34+
packages/react-styles/css
35+
key: ${{ runner.os }}-dist-16-${{ secrets.CACHE_VERSION }}-${{ hashFiles('yarn.lock', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }}
36+
- name: Build dist
37+
run: yarn build
38+
if: steps.dist.outputs.cache-hit != 'true'
39+
- name: Release to NPM
40+
run: cd packages/module && npx [email protected] --dry-run

release.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
branches: [
3+
'main',
4+
{ name: 'main', channel: 'prerelease', prerelease: 'prerelease' },
5+
],
6+
analyzeCommits: {
7+
preset: 'angular'
8+
},
9+
plugins: [
10+
'@semantic-release/commit-analyzer',
11+
'@semantic-release/release-notes-generator',
12+
'@semantic-release/github',
13+
['@semantic-release/npm', { pkgRoot: 'dist' }]
14+
],
15+
tagFormat: 'prerelease-v${version}'
16+
};

0 commit comments

Comments
 (0)