-
Notifications
You must be signed in to change notification settings - Fork 26
88 lines (71 loc) · 2.67 KB
/
bundle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Build and Upload Core Bundle or cardano-connect.js to GitHub Pages
on:
push:
branches:
- main
workflow_dispatch:
jobs:
upload-core-bundle:
if: "contains(github.event.head_commit.message, 'release-please--branches--main--components--cardano-connect-with-wallet-core')"
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@v3
- name: 🫡 Setup node
uses: actions/setup-node@v1
with:
node-version: 18.12.0
- name: 🧘♀️ Download dependencies
run: npm ci
- name: 📦 Make bundle
run: npm run bundle:core
- name: 👀 Lookup version
run: |
echo "VERSION=$(sed -n 's/.*\"version\": *\"\([^\"]*\)\".*/\1/p' core/package.json)" >> $GITHUB_ENV
- name: 🎨 Create bundle folder
run: mkdir -p core/bundle-${{ env.VERSION }}
- name: 💃🏻 Move files into the bundle folder
run: |
mv core/dist/index.js core/bundle-${{ env.VERSION }}/index.js
mv core/dist/index.js.map core/bundle-${{ env.VERSION }}/index.js.map
- name: 📅 Publish latest bundle on gh-pages
uses: JamesIves/github-pages-deploy-action@v4
with:
BRANCH: gh-pages
folder: core/bundle-${{ env.VERSION }}
target-folder: bundle-latest/
- name: 🥁 Publish bundle with version on gh-pages
uses: JamesIves/github-pages-deploy-action@v4
with:
BRANCH: gh-pages
folder: core/bundle-${{ env.VERSION }}
target-folder: bundle-${{ env.VERSION }}/
upload-cardano-connect-js:
if: "contains(github.event.head_commit.message, 'release-please--branches--main--components--cardano-connect-js')"
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@v3
- name: 🫡 Setup node
uses: actions/setup-node@v1
with:
node-version: 18.12.0
- name: 🧘♀️ Download dependencies
run: npm ci
- name: 📦 Make bundle
run: npm run bundle:html
- name: 👀 Lookup version
run: |
echo "VERSION=$(cat html/version.txt)" >> $GITHUB_ENV
- name: 📅 Publish latest cardano-connect-js lib on gh-pages
uses: JamesIves/github-pages-deploy-action@v4
with:
BRANCH: gh-pages
folder: html
target-folder: cardano-connect-latest/
- name: 🥁 Publish bundle with version on gh-pages
uses: JamesIves/github-pages-deploy-action@v4
with:
BRANCH: gh-pages
folder: html
target-folder: cardano-connect-${{ env.VERSION }}/