Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: prepare for npm-packaging #21

Merged
merged 6 commits into from
Nov 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions .github/workflows/pr_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Check PR
on:
pull_request:
branches:
- master
- master

jobs:
build:
Expand All @@ -12,21 +12,21 @@ jobs:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/setup-node@v1
with:
node-version: 10
- uses: actions/checkout@v1
- name: Install esy
run: npm install -g [email protected]
- name: Install dependencies
run: esy install
- name: Build
run: esy build
- name: Check code formatting
run: esy dune build @fmt --root .
- name: Run tests
run: |
esy dune exec test/Method.exe -- -o ./test/__logs__
esy dune exec test/Status.exe -- -o ./test/__logs__
- name: Run example
run: esy example
- uses: actions/setup-node@v1
with:
node-version: 10
- uses: actions/checkout@v1
- name: Install esy
run: npm install -g [email protected]
- name: Install dependencies
run: esy install
- name: Build
run: esy build
- name: Check code formatting
run: esy dune build @fmt --root .
- name: Run tests
run: |
esy dune exec test/Method.exe -- -o ./test/__logs__
esy dune exec test/Status.exe -- -o ./test/__logs__
- name: Run example
run: esy example
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release Packages

on:
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
package: [fetch-core, fetch-native-lwt]
steps:
- uses: actions/setup-node@v1
with:
node-version: 10
- uses: actions/checkout@v1
- name: Package files
run: |
cp ${{ matrix.package }}.json ./src/${{ matrix.package }}/package.json
cp ${{ matrix.package }}.opam ./src/${{ matrix.package }}
cp LICENSE ./src/${{ matrix.package }}
- name: NPM Package
run: |
cd src/${{ matrix.package }}
ls -lah
npm pack
8 changes: 8 additions & 0 deletions clean-npm-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

for package in fetch-core fetch-native-lwt
do
rm ./src/$package/package.json
rm ./src/$package/$package.opam
rm ./src/$package/LICENSE
done
8 changes: 8 additions & 0 deletions prepare-npm-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

for package in fetch-core fetch-native-lwt
do
cp $package.json ./src/$package/package.json
cp $package.opam ./src/$package
cp LICENSE ./src/$package
done
3 changes: 3 additions & 0 deletions src/fetch-core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
LICENSE
package.json
*.opam
3 changes: 3 additions & 0 deletions src/fetch-native-lwt/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
LICENSE
package.json
*.opam