Skip to content

Commit

Permalink
Package exports (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
smikhalevski authored Aug 27, 2023
1 parent e643f42 commit e06e56d
Show file tree
Hide file tree
Showing 23 changed files with 2,260 additions and 1,478 deletions.
37 changes: 23 additions & 14 deletions .github/workflows/release.yml → .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: release
name: publish

on:
push:
Expand All @@ -10,42 +10,51 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: "18"
node-version: "20"
cache: npm
registry-url: "https://registry.npmjs.org"

- name: Configure git user
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
- run: npm ci
- run: npm run build
- run: npm run docs
- run: npm test

- run: npm publish
- name: Publish package
working-directory: ./lib
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Push docs to ghpages
- name: Publish docs
run: |
set -x
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
TEMP_DIR=$(mktemp -d)
mv ./docs $TEMP_DIR
mv ./docs /tmp/docs
git reset HEAD --hard
git fetch origin ghpages:ghpages
git checkout ghpages
git rm -rf .
git rm -rf --ignore-unmatch .
git clean -fxd
cp -R $TEMP_DIR/docs/. .
cp -R /tmp/docs/. .
git add .
git commit -m "Updated docs ($(git rev-parse --short $GITHUB_SHA))"
! git diff --staged --quiet --exit-code || exit 0
git commit -m "Updated docs (${GITHUB_SHA::7})"
git push origin ghpages
- run: gh release create ${{ github.ref_name }} --generate-notes --draft
- name: Create release draft
run: gh release create ${{ github.ref_name }} --generate-notes --draft
env:
GH_TOKEN: ${{ github.token }}
8 changes: 2 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: [ pull_request ]

jobs:

Expand All @@ -14,7 +10,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
node-version: "20"
cache: npm
- run: npm ci
- run: npm run build
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
gen/
lib/
docs/
coverage/
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# parallel-universe [![build](https://github.com/smikhalevski/parallel-universe/actions/workflows/test.yml/badge.svg?branch=master&event=push)](https://github.com/smikhalevski/parallel-universe/actions/workflows/test.yml)

<a href="#readme">
<img alt="Spaceman" src="./spaceman.png"/>
</a>
<p align="center">
<a href="#readme">
<img alt="Spaceman" src="./spaceman.png"/>
</a>
</p>

The set of async flow control structures and promise utils.

Expand Down
9 changes: 8 additions & 1 deletion jest.config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{
"preset": "ts-jest"
"preset": "ts-jest",
"testMatch": [
"<rootDir>/src/test/**/*.test.ts"
],
"modulePathIgnorePatterns": [
"<rootDir>/gen",
"<rootDir>/lib"
]
}
Loading

0 comments on commit e06e56d

Please sign in to comment.