Skip to content

Commit fff5408

Browse files
Alenardlachaume
andcommitted
ci: adapt workflows to new mithril-client-wasm structure
Co-authored-by: Damien Lachaume <[email protected]>
1 parent 1288f4a commit fff5408

File tree

3 files changed

+23
-14
lines changed

3 files changed

+23
-14
lines changed

.github/workflows/actions/publish-npm-package/action.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,24 @@ runs:
7474
7575
- name: Build package
7676
shell: bash
77+
working-directory: ${{ inputs.package }}
78+
env:
79+
WASM_PACK_ARGS: --release --scope ${{ inputs.scope }}
7780
run: |
7881
echo "Build '@${{ inputs.scope }}/${{ inputs.package }}' package"
79-
cp ./LICENSE ./mithril-client-wasm/
80-
cp -f ./mithril-client-wasm/npm/README.md ./mithril-client-wasm/
81-
wasm-pack build ${{ inputs.package }} --release --target web --out-dir ./pkg --scope ${{ inputs.scope }} --out-name index
82+
make build
83+
84+
- name: Prepare publish
85+
shell: bash
86+
run: |
87+
cp ./LICENSE ${{ inputs.package }}
88+
cp -f ${{ inputs.package }}/npm/README.md ${{ inputs.package }}/
8289
8390
- name: List package
8491
shell: bash
8592
run: |
8693
echo "List '@${{ inputs.scope }}/${{ inputs.package }}' package"
87-
ls -al ${{ inputs.package }}/pkg
94+
ls -al -R ${{ inputs.package }}/dist
8895
8996
- name: Publish package new version
9097
if: steps.check_version.outputs.deploy_mode == 'publish'
@@ -99,7 +106,7 @@ runs:
99106
else
100107
npm whoami
101108
fi
102-
cd ${{ inputs.package }}/pkg
109+
cd ${{ inputs.package }}/
103110
if [ "${{ inputs.dry_run }}" == "false" ]; then
104111
dry_run_option=""
105112
else
@@ -116,6 +123,6 @@ runs:
116123
echo "Publish '@${{ inputs.scope }}/${{ inputs.package }}' package"
117124
npm set "//registry.npmjs.org/:_authToken=${NPM_TOKEN}"
118125
npm whoami
119-
cd ${{ inputs.package }}/pkg
126+
cd ${{ inputs.package }}/
120127
npm dist-tag add @${{ inputs.scope }}/${{ inputs.package }}@${{ steps.check_version.outputs.package_version }} latest
121128
npm dist-tag rm @${{ inputs.scope }}/${{ inputs.package }}@${{ steps.check_version.outputs.package_version }} next

.github/workflows/ci.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,17 @@ jobs:
125125

126126
- name: Build 'mithril-client-wasm' library
127127
shell: bash
128-
run: |
129-
cp LICENSE ./mithril-client-wasm/
130-
wasm-pack build mithril-client-wasm --release --target web --out-dir ./pkg --scope mithril-dev --out-name index
128+
working-directory: mithril-client-wasm
129+
env:
130+
WASM_PACK_ARGS: --release --scope mithril-dev
131+
run: make build
131132

132133
- name: Prepare 'mithril-client-wasm' package
133134
shell: bash
135+
working-directory: mithril-client-wasm
134136
run: |
135-
cp LICENSE ./mithril-client-wasm/
136-
wasm-pack pack mithril-client-wasm/pkg
137+
cp LICENSE ./mithril-client-wasm/ && cp npm/README.md .
138+
npm pack
137139
138140
- name: Build a fake aggregator
139141
shell: bash
@@ -163,7 +165,7 @@ jobs:
163165
with:
164166
name: mithril-distribution-wasm
165167
path: |
166-
mithril-client-wasm/**/*-mithril-client-wasm-*.tgz
168+
mithril-client-wasm/*-mithril-client-wasm-*.tgz
167169
if-no-files-found: error
168170
test:
169171
strategy:
@@ -832,7 +834,7 @@ jobs:
832834

833835
- name: Unpack 'mithril-client-wasm' package
834836
working-directory: mithril-client-wasm
835-
run: tar -xvzf pkg/*.tgz -C pkg/ && mv pkg/package/* pkg/
837+
run: tar -xvzf *.tgz && mv package/dist .
836838

837839
- name: Setup Node.js
838840
uses: actions/setup-node@v4

.github/workflows/test-client.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ jobs:
296296

297297
- name: Unpack 'mithril-client-wasm' package
298298
working-directory: mithril-client-wasm
299-
run: tar -xvzf pkg/*.tgz -C pkg/ && mv pkg/package/* pkg/
299+
run: tar -xvzf *.tgz && mv package/dist .
300300

301301
- name: Install dependencies
302302
working-directory: mithril-client-wasm

0 commit comments

Comments
 (0)