Skip to content
This repository was archived by the owner on Dec 22, 2024. It is now read-only.

Commit e2d31ec

Browse files
committed
chore: add release dependencies
1 parent 072f96d commit e2d31ec

File tree

4 files changed

+1840
-29
lines changed

4 files changed

+1840
-29
lines changed

.github/workflows/cd-registry.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Continuous deployment to package registries
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
build-and-deploy:
10+
name: Build and deploy NPM package
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repo
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: '0'
17+
18+
- name: Setup pnpm
19+
uses: pnpm/action-setup@v2
20+
21+
- name: Configure node for NPM registry as registry
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '20.x'
25+
cache: "pnpm"
26+
registry-url: 'https://registry.npmjs.org'
27+
scope: '@openscript-ch'
28+
29+
- name: Install dependencies
30+
run: pnpm install --frozen-lockfile
31+
32+
- name: Create Github release
33+
run: pnpm release:create-github-release
34+
env:
35+
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{secrets.GITHUB_TOKEN}}
36+
37+
- run: pnpm publish --access public --no-git-checks
38+
env:
39+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
40+
41+
- name: Configure node for Github registry as registry
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: '20.x'
45+
registry-url: 'https://npm.pkg.github.com'
46+
scope: '@openscript-ch'
47+
48+
- name: Authenticate with the GitHub Package Registry
49+
run:
50+
echo "//npm.pkg.github.com:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
51+
52+
- name: Publish package on Github NPM registry
53+
run: pnpm publish --no-git-checks
54+
env:
55+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,19 @@
1111
],
1212
"scripts": {
1313
"build": "tsc",
14-
"test": "echo \"Error: no test specified\" && exit 1"
14+
"test": "echo \"Error: no test specified\" && exit 1",
15+
"release:major": "standard-version --release-as major && git push --follow-tags",
16+
"release:minor": "standard-version --release-as minor && git push --follow-tags",
17+
"release:patch": "standard-version --release-as patch && git push --follow-tags",
18+
"release:create-github-release": "conventional-github-releaser -p angular"
1519
},
1620
"keywords": [],
1721
"author": "openscript Ltd. <hi@openscript.ch>",
1822
"license": "MIT",
1923
"dependencies": {
2024
"@automerge/automerge-repo": "^1.0.19",
25+
"conventional-github-releaser": "^3.1.5",
26+
"standard-version": "^9.5.0",
2127
"typescript": "^5.3.3"
2228
},
2329
"publishConfig": {

0 commit comments

Comments
 (0)