Skip to content

Commit b020b07

Browse files
committed
publish client
1 parent 70943c2 commit b020b07

File tree

15 files changed

+49
-61
lines changed

15 files changed

+49
-61
lines changed

.github/workflows/release-client.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
name: Server - Release
22

3+
#on:
4+
# push:
5+
# tags:
6+
# - "v*.*.*"
37
on:
48
push:
5-
tags:
6-
- "v*.*.*"
9+
branches: [ "main" ]
10+
pull_request:
11+
branches: [ "main" ]
712

813
env:
914
node_version: 14
@@ -23,6 +28,8 @@ jobs:
2328
with:
2429
version: 'latest'
2530
# see https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
26-
- run: ./scripts/publish-server.sh ${{ github.event.release.tag_name }}
31+
- run: |
32+
# ./scripts/publish-server.sh ${{ github.event.release.tag_name }}
33+
./scripts/publish-client.sh 0.0.1
2734
env:
2835
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
### Run remote web client locally
2020

2121
- `./build-remote-client.sh`
22-
- `cd client/remote_client/dist`
22+
- `cd client/js/dist`
2323
- `basic-http-server .`
2424
- `google-chrome --disable-web-security --user-data-dir=/tmp http://localhost:8612`
2525

@@ -100,7 +100,7 @@ diff --git a/apps/api/app/resources.ts b/apps/api/app/resources.ts
100100
const viewer: ViewerInfo =
101101
gameInfo?.viewer?.alternate?.url && ctx.query.alternate === "1" ? gameInfo?.viewer.alternate : gameInfo.viewer;
102102
- const viewerUrl = ctx.query.customViewerUrl || viewer.url;
103-
+ const viewerUrl = "/home/gregor/source/clash/client/remote_client/index.js";
103+
+ const viewerUrl = "/home/gregor/source/clash/client/js/index.js";
104104

105105
ctx.body = `
106106
<html>
File renamed without changes.

client/remote_client/package-lock.json renamed to client/js/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/js/package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "@boardgamers/clash-client",
3+
"description": "A client for Clash of Cultures",
4+
"version": "0.1.0",
5+
"license": "MIT",
6+
"repository": {
7+
"type": "git",
8+
"url": "git@github.com:boardgamers/clash.git"
9+
},
10+
"files": [
11+
"assets/",
12+
"client.js",
13+
"client.wasm"
14+
],
15+
"main": "index.js",
16+
"homepage": "https://www.boardgamers.space/",
17+
"scripts": {
18+
"build": "webpack"
19+
},
20+
"devDependencies": {
21+
"webpack": "^5.94.0",
22+
"webpack-cli": "^5.1.4"
23+
},
24+
"dependencies": {
25+
"events": "^3.3.0"
26+
}
27+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

client/remote_client/package.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

client/src/remote_client/bin/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extern "C" {
1515
fn log(s: &str);
1616
}
1717

18-
#[wasm_bindgen(module = "/remote_client/src/control.js")]
18+
#[wasm_bindgen(module = "/js/src/control.js")]
1919
extern "C" {
2020
type Control;
2121

scripts/build-remote-client.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,16 @@ sed -i "s/let wasm;/let wasm; export const set_wasm = (w) => wasm = w;/" dist/"$
7272
sed -i "s/imports\['env'\] = __wbg_star0;/return imports.wbg\;/" dist/"$PROJECT_NAME".js
7373
sed -i "s/const imports = __wbg_get_imports();/return __wbg_get_imports();/" dist/"$PROJECT_NAME".js
7474

75-
pushd remote_client
75+
pushd js
7676
mkdir -p dist
7777
rm -rf dist/*
7878
npm run build
7979
cp -r ../assets dist/
80+
cp package.json dist/
8081
pushd dist
8182
mv *.wasm client.wasm
8283
popd
83-
popd # remote_client
84+
popd # js
8485

8586
popd # client
8687

scripts/publish-client.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -euo pipefail
44

5-
VERSION=$1
5+
VERSION=${1:-}
66
if [ -z "$VERSION" ]; then
77
echo "Usage: $0 <version>"
88
exit 1
@@ -12,9 +12,8 @@ echo "Building client..."
1212
./scripts/build-remote-client.sh # --release
1313

1414
echo "Publishing client..."
15-
pushd client
16-
sed -i 's#"name": "client"#"name": "@boardgamers/clash-client"#' pkg/package.json
17-
sed -i "s#\"version\": \"0.1.0\"#\"version\": \"$VERSION\"#" pkg/package.json
15+
pushd client/js/dist
16+
sed -i "s#\"version\": \"0.1.0\"#\"version\": \"$VERSION\"#" package.json
1817
npm publish --access public
1918
popd
2019

scripts/publish-server.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -euo pipefail
44

5-
VERSION=$1
5+
VERSION=${1:-}
66
if [ -z "$VERSION" ]; then
77
echo "Usage: $0 <version>"
88
exit 1

0 commit comments

Comments
 (0)