-
Notifications
You must be signed in to change notification settings - Fork 31
95 lines (73 loc) · 2.53 KB
/
npm-publish.yml
File metadata and controls
95 lines (73 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: NPM Publish
run-name: ${{ inputs.description }} (${{ inputs.release_type }}) release by @${{ github.actor }}
on:
workflow_dispatch:
inputs:
description:
description: "Description"
required: false
type: string
release_type:
description: "Release Type"
required: true
default: "patch"
type: choice
options:
- "patch"
- "minor"
- "major"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install
- run: bun lint
- run: bun typecheck
- run: bun run test
publish-to-npm:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: git config user.name "$(git log -n 1 --pretty=format:%an)"
- run: git config user.email "$(git log -n 1 --pretty=format:%ae)"
- run: bun install
- run: bun run nail-workspace-dependency-versions
- run: npm version ${{ github.event.inputs.release_type }}
working-directory: packages/react-native-device-activity
- run: |
VERSION=$(node -p "require('./package.json').version")
echo "versionTag=v${VERSION}" >> $GITHUB_ENV
working-directory: packages/react-native-device-activity
- name: Setup NPM Authentication
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
- run: git add packages/react-native-device-activity/package.json
- run: |
git commit -m 'chore: update version' --no-verify
- run: npm publish
working-directory: packages/react-native-device-activity
- run: |
git status
git branch -a
git log -1
git push origin HEAD --no-verify
git push origin --tags --no-verify
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Release
uses: softprops/action-gh-release@v1
with:
name: ${{ env.versionTag }} ${{ github.event.inputs.description }}
tag_name: ${{ env.versionTag }}
generate_release_notes: true