|
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 }} |
0 commit comments