Skip to content

Commit

Permalink
Try and push npm package to GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Nov 9, 2024
1 parent a8c176e commit e386525
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,29 @@ jobs:
- name: Generate ReScript code
working-directory: ./tools/TypeScript-DOM-lib-generator
run: npm run build

- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]

- name: Get short commit hash
id: vars
run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV

- name: Update version to -<commit-hash>
run: npm version --no-git-tag-version "${{ steps.package-version.outputs.current-version }}-${{ env.COMMIT_HASH }}"

- name: Package npm project
run: npm pack

- name: Upload npm package artifact
uses: actions/upload-artifact@v3
with:
name: npm-package
path: '*.tgz'

- name: Publish to GitHub Packages
if: github.ref == 'refs/heads/main'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm publish ./*.tgz --registry=https://npm.pkg.github.com/
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
{
"name": "experimental-rescript-webapi",
"version": "1.0.0",
"version": "0.1.0",
"description": "Experimental successor to [rescript-webapi](https://github.com/TheSpyder/rescript-webapi)",
"main": "index.js",
"author": {
"name": "Florian Verdonck"
},
"maintainers": [
"Florian Verdonck (https://github.com/nojaf)"
],
"files": [
"src/**/*.res"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"license": "MIT",
"dependencies": {
"rescript": "^12.0.0-alpha.4"
}
Expand Down

0 comments on commit e386525

Please sign in to comment.