Skip to content

Commit e386525

Browse files
committed
Try and push npm package to GitHub
1 parent a8c176e commit e386525

File tree

3 files changed

+39
-6
lines changed

3 files changed

+39
-6
lines changed

.github/workflows/ci.yml

+26
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,29 @@ jobs:
3131
- name: Generate ReScript code
3232
working-directory: ./tools/TypeScript-DOM-lib-generator
3333
run: npm run build
34+
35+
- name: get-npm-version
36+
id: package-version
37+
uses: martinbeentjes/[email protected]
38+
39+
- name: Get short commit hash
40+
id: vars
41+
run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
42+
43+
- name: Update version to -<commit-hash>
44+
run: npm version --no-git-tag-version "${{ steps.package-version.outputs.current-version }}-${{ env.COMMIT_HASH }}"
45+
46+
- name: Package npm project
47+
run: npm pack
48+
49+
- name: Upload npm package artifact
50+
uses: actions/upload-artifact@v3
51+
with:
52+
name: npm-package
53+
path: '*.tgz'
54+
55+
- name: Publish to GitHub Packages
56+
if: github.ref == 'refs/heads/main'
57+
env:
58+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
run: npm publish ./*.tgz --registry=https://npm.pkg.github.com/

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
{
22
"name": "experimental-rescript-webapi",
3-
"version": "1.0.0",
3+
"version": "0.1.0",
44
"description": "Experimental successor to [rescript-webapi](https://github.com/TheSpyder/rescript-webapi)",
5-
"main": "index.js",
5+
"author": {
6+
"name": "Florian Verdonck"
7+
},
8+
"maintainers": [
9+
"Florian Verdonck (https://github.com/nojaf)"
10+
],
11+
"files": [
12+
"src/**/*.res"
13+
],
614
"scripts": {
715
"test": "echo \"Error: no test specified\" && exit 1"
816
},
917
"keywords": [],
10-
"author": "",
11-
"license": "ISC",
18+
"license": "MIT",
1219
"dependencies": {
1320
"rescript": "^12.0.0-alpha.4"
1421
}

0 commit comments

Comments
 (0)