Skip to content

Commit c9b7b36

Browse files
committed
ci: create release workflow
1 parent 9c84741 commit c9b7b36

File tree

5 files changed

+41
-16
lines changed

5 files changed

+41
-16
lines changed

.config/release-it.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { Config } from "release-it";
2+
3+
export default {
4+
git: {
5+
commitArgs: ["--no-verify"],
6+
},
7+
} satisfies Config;

.github/actions/setup/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ description: Setup Node.js and install dependencies
44
runs:
55
using: composite
66
steps:
7+
- name: Checkout Repository
8+
uses: actions/checkout@v4
9+
710
- uses: actions/setup-node@v4
811
with:
912
node-version-file: ".nvmrc"

.github/workflows/ci.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ jobs:
1717
lint:
1818
runs-on: ubuntu-latest
1919
steps:
20-
- name: Checkout
21-
uses: actions/checkout@v4
22-
2320
- name: Setup
2421
uses: ./.github/actions/setup
2522

@@ -32,9 +29,6 @@ jobs:
3229
test:
3330
runs-on: ubuntu-latest
3431
steps:
35-
- name: Checkout
36-
uses: actions/checkout@v4
37-
3832
- name: Setup
3933
uses: ./.github/actions/setup
4034

@@ -44,9 +38,6 @@ jobs:
4438
build-library:
4539
runs-on: ubuntu-latest
4640
steps:
47-
- name: Checkout
48-
uses: actions/checkout@v4
49-
5041
- name: Setup
5142
uses: ./.github/actions/setup
5243

@@ -59,9 +50,6 @@ jobs:
5950
build-web:
6051
runs-on: ubuntu-latest
6152
steps:
62-
- name: Checkout
63-
uses: actions/checkout@v4
64-
6553
- name: Setup
6654
uses: ./.github/actions/setup
6755

@@ -78,9 +66,6 @@ jobs:
7866
build-ios-dev:
7967
runs-on: macos-15
8068
steps:
81-
- name: Checkout
82-
uses: actions/checkout@v4
83-
8469
- name: Setup
8570
uses: ./.github/actions/setup
8671

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release & Publish to NPM
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
release:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Setup
10+
uses: ./.github/actions/setup
11+
12+
- name: Initialize Git user
13+
shell: bash
14+
run: |
15+
git config user.name "github-actions"
16+
git config user.email "mwlawlor@gmail.com"
17+
18+
- name: Setup NPM registry
19+
run: |
20+
npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
21+
env:
22+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
23+
24+
- name: Run release
25+
run: |
26+
yarn release --ci --preRelease --dry-run
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,5 @@ nitrogen/
8585
# generated by bob
8686
dist/
8787

88-
.env
88+
.env
89+
.npmrc

0 commit comments

Comments
 (0)