File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : NPM Publish
2+ run-name : ${{ inputs.description }} (${{ inputs.release_type }}) release by @${{ github.actor }}
3+
4+ on :
5+ workflow_dispatch :
6+ inputs :
7+ description :
8+ description : ' Description for the release'
9+ required : false
10+ type : string
11+ release_type :
12+ description : ' Release Type'
13+ required : true
14+ default : ' patch'
15+ type : choice
16+ options :
17+ - ' patch'
18+ - ' minor'
19+ - ' major'
20+
21+ jobs :
22+ test :
23+ runs-on : ubuntu-latest
24+ steps :
25+ - name : Checkout code
26+ uses : actions/checkout@v3
27+
28+ - name : Set up Node.js
29+ uses : actions/setup-node@v3
30+ with :
31+ node-version : ' 20'
32+ cache : ' npm'
33+
34+ - name : Install dependencies
35+ run : npm install
36+
37+ - name : Run linting
38+ run : npm run lint
39+
40+ - name : Run typechecking
41+ run : npm run typecheck
42+
43+ publish-to-npm :
44+ needs : test
45+ runs-on : ubuntu-latest
46+ steps :
47+ - name : Checkout code
48+ uses : actions/checkout@v3
49+
50+ - name : Set up Node.js
51+ uses : actions/setup-node@v3
52+ with :
53+ node-version : ' 20'
54+ cache : ' npm'
55+ registry-url : https://registry.npmjs.org/
56+
57+ - name : Set Git config
58+ run : |
59+ git config user.name "$(git log -n 1 --pretty=format:%an)"
60+ git config user.email "$(git log -n 1 --pretty=format:%ae)"
61+
62+ - name : Update version
63+ id : update_version
64+ run : echo "VERSION=$(npm version ${{ github.event.inputs.release_type }} -m \"%s ${{ github.event.inputs.description }}\")" >> $GITHUB_ENV
65+
66+ - name : Install dependencies
67+ run : npm install
68+
69+ - name : Publish to NPM
70+ run : npm publish
71+ env :
72+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
73+
74+ - name : Push tags
75+ run : git push --follow-tags
76+ env :
77+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
78+
79+ - name : Create GitHub Release
80+ uses : softprops/action-gh-release@v1
81+ with :
82+ name : ${{ env.VERSION }} ${{ github.event.inputs.description }}
83+ tag_name : ${{ env.VERSION }}
84+ generate_release_notes : true
Original file line number Diff line number Diff line change 1+ name : Test
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ pull_request :
8+
9+ jobs :
10+ test :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Checkout code
15+ uses : actions/checkout@v3
16+
17+ - name : Set up Node.js
18+ uses : actions/setup-node@v3
19+ with :
20+ node-version : ' 20'
21+ cache : ' npm'
22+
23+ - name : Install dependencies
24+ run : npm install
25+
26+ - name : Run lint
27+ run : npm run lint
28+
29+ - name : Run typecheck
30+ run : npm run typecheck
Original file line number Diff line number Diff line change 1+ npm run-prepush
Original file line number Diff line number Diff line change 99 "clean" : " expo-module clean" ,
1010 "lint" : " expo-module lint" ,
1111 "test" : " expo-module test" ,
12+ "pre-push" : " npm run typecheck && npm run lint" ,
13+ "typecheck" : " tsc --noEmit" ,
1214 "prepare" : " expo-module prepare" ,
1315 "prepublishOnly" : " expo-module prepublishOnly" ,
1416 "expo-module" : " expo-module" ,
You can’t perform that action at this time.
0 commit comments