Skip to content

Commit e820fc1

Browse files
Merge pull request #1305 from Py4Js/feature/fixed-ci
fixed ci/cd
2 parents 087296c + a135f88 commit e820fc1

File tree

4 files changed

+69
-70
lines changed

4 files changed

+69
-70
lines changed

.github/workflows/deploy.yaml

Lines changed: 56 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,56 @@
1-
# on:
2-
# push:
3-
# branches: [main]
4-
5-
# jobs:
6-
# build:
7-
# runs-on: ubuntu-latest
8-
# steps:
9-
# - name: Checkout repository
10-
# uses: actions/checkout@v3
11-
12-
# - name: Setup Node
13-
# uses: actions/setup-node@v3
14-
# with:
15-
# node-version: "lts/*"
16-
# registry-url: "https://registry.npmjs.org"
17-
18-
# - name: Install dependencies
19-
# run: yarn --ignore-engines
20-
21-
#- name: Run tests
22-
# run: yarn run test
23-
24-
# - name: Build project
25-
# run: yarn run build #--target npm
26-
27-
# - name: Create zip lib
28-
# uses: vimtor/action-zip@v1
29-
# with:
30-
# files: library/
31-
# dest: pyscript-react.zip
32-
33-
# - name: Get current tag
34-
# run: |
35-
# echo "current_tag=v`grep version package.json | sed 's/.*"version": "\(.*\)".*/\1/'`" >> $GITHUB_ENV
36-
37-
# - name: Create new tag
38-
# uses: rickstaa/action-create-tag@v1
39-
# id: "tag_create"
40-
# with:
41-
# tag: "${{ env.current_tag }}"
42-
# tag_exists_error: true
43-
# message: "Latest release"
44-
45-
# - name: Create GitHub realese
46-
# uses: "marvinpinto/action-automatic-releases@latest"
47-
# with:
48-
# repo_token: "${{ secrets.GITHUB_TOKEN }}"
49-
# automatic_release_tag: "${{ env.current_tag }}"
50-
# prerelease: false
51-
# files: |
52-
# LICENSE
53-
# pyscript-react.zip
54-
55-
# - name: Publish to npm 🚀
56-
# run: |
57-
# cd library
58-
# yarn publish
59-
# cd ..
60-
# for dir in library/*; do
61-
# if [ -d "$dir" ]; then
62-
# cd "$dir"
63-
# yarn publish
64-
# cd ../../
65-
# fi
66-
# done
67-
# env:
68-
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1+
on:
2+
push:
3+
branches: [main]
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout repository
9+
uses: actions/checkout@v3
10+
- name: Setup Node
11+
uses: actions/setup-node@v3
12+
with:
13+
node-version: "lts/*"
14+
registry-url: "https://registry.npmjs.org"
15+
- name: Install dependencies
16+
run: yarn --ignore-engines
17+
- name: Build project
18+
run: yarn run build #--target npm
19+
- name: Create zip lib
20+
uses: vimtor/action-zip@v1
21+
with:
22+
files: library/
23+
dest: pyscript-react.zip
24+
- name: Get current tag
25+
run: |
26+
echo "current_tag=v`grep version package.json | sed 's/.*"version": "\(.*\)".*/\1/'`" >> $GITHUB_ENV
27+
- name: Create new tag
28+
uses: rickstaa/action-create-tag@v1
29+
id: "tag_create"
30+
with:
31+
tag: "${{ env.current_tag }}"
32+
tag_exists_error: true
33+
message: "Latest release"
34+
- name: Create GitHub realese
35+
uses: "marvinpinto/action-automatic-releases@latest"
36+
with:
37+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
38+
automatic_release_tag: "${{ env.current_tag }}"
39+
prerelease: false
40+
files: |
41+
LICENSE
42+
pyscript-react.zip
43+
- name: Publish to npm 🚀
44+
run: |
45+
cd library
46+
yarn publish
47+
cd ..
48+
for dir in library/*; do
49+
if [ -d "$dir" ]; then
50+
cd "$dir"
51+
yarn publish
52+
cd ../../
53+
fi
54+
done
55+
env:
56+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
"sort-package-json": "^2.4.1",
8686
"source-map-loader": "^4.0.1",
8787
"storybook": "^7.0.7",
88+
"super-expressive": "^2.0.0",
8889
"ts-jest": "^29.1.0",
8990
"ts-node": "^10.9.1",
9091
"ts-patch": "^2.1.0",

source/scripts/build/wrappers/get-entrypoints/get-entrypoints.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { globSync } from "glob";
2-
import { join } from "path";
2+
import { join, sep } from "path";
3+
import SuperExpressive from "super-expressive";
34
import type { GetEntrypoints } from "~root/source/scripts/build/wrappers/get-entrypoints/get-entrypoints.types";
45

56
const getEntrypoints: GetEntrypoints = (): Record<string, string> => {
@@ -21,7 +22,11 @@ const getEntrypoints: GetEntrypoints = (): Record<string, string> => {
2122
splittedFile.pop();
2223
const deletedExtensionFile = splittedFile.join();
2324
const fixedFileName = deletedExtensionFile.replace(
24-
/^(source\\library\\)/,
25+
SuperExpressive()
26+
.startOfInput.string("source")
27+
.string(sep)
28+
.string("library")
29+
.toRegex(),
2530
"",
2631
);
2732
accumulator[fixedFileName] = join(process.cwd(), file);

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15422,6 +15422,11 @@ stylis@4.1.3:
1542215422
resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.1.3.tgz#fd2fbe79f5fed17c55269e16ed8da14c84d069f7"
1542315423
integrity sha512-GP6WDNWf+o403jrEp9c5jibKavrtLW+/qYGhFxFrG8maXhwTBI7gLLhiBb0o7uFccWN+EOS9aMO6cGHWAO07OA==
1542415424

15425+
super-expressive@^2.0.0:
15426+
version "2.0.0"
15427+
resolved "https://registry.yarnpkg.com/super-expressive/-/super-expressive-2.0.0.tgz#646c4c6b7d813d47196cf144df36366f90bec456"
15428+
integrity sha512-jtCS9dEBPxtq4jd0v33LnRPI0kYQP1npHxzl+Pk+IOuufIn5Pyo0AXiU6ypvhO3vZevqEE9AE3YDD7aWp+RxRg==
15429+
1542515430
supports-color@^5.3.0:
1542615431
version "5.5.0"
1542715432
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"

0 commit comments

Comments
 (0)