Skip to content

Commit 5f265f0

Browse files
committed
publish server
1 parent c14f971 commit 5f265f0

File tree

9 files changed

+86
-15
lines changed

9 files changed

+86
-15
lines changed

.github/workflows/rust.yml .github/workflows/check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Rust
1+
name: Check All
22

33
on:
44
push:

.github/workflows/release.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Server - Release
2+
3+
on:
4+
push:
5+
branches:
6+
- remote_client
7+
#on:
8+
# push:
9+
# tags:
10+
# - "v*.*.*"
11+
12+
env:
13+
node_version: 14
14+
15+
defaults:
16+
run:
17+
working-directory: server
18+
19+
jobs:
20+
version_and_release:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v2
24+
- name: Use Node.js ${{ env.node_version }}
25+
uses: actions/setup-node@v2
26+
with:
27+
node-version: ${{ env.node_version }}
28+
# setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED
29+
registry-url: "https://registry.npmjs.org"
30+
- uses: jetli/[email protected]
31+
with:
32+
version: 'latest'
33+
- run: ./scripts/publish-server.sh 0.0.1 # pass the version as an argument ${{ github.event.release.tag_name }} https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
34+
env:
35+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

RELEASING.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Releasing
2+
3+
1. Go to https://github.com/boardgamers/clash/releases/new
4+
2. Click on "Choose a tag", enter the tag name (e.g. `v0.1.0`), and click "Create a new tag".
5+
3. Click on "Generate release notes" to auto-generate the release notes based on the commits since the last release.
6+
4. Click on "Publish release".

client/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name = "client"
33
version = "0.1.0"
44
edition = "2021"
55
default-run = "local_client"
6+
license = "MIT"
7+
repository = "[email protected]:boardgamers/clash.git"
8+
homepage = "https://www.boardgamers.space/"
9+
description = "A client for Clash of Cultures"
610

711
[profile.dev]
812
debug = true
+6-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
const path = require('path');
22

33
module.exports = {
4-
entry: './src/index.js',
5-
output: {
6-
filename: 'client.js',
7-
path: path.resolve(__dirname, 'dist'),
8-
},
9-
resolve: {
4+
entry: './src/index.js', output: {
5+
filename: 'client.js', path: path.resolve(__dirname, 'dist'),
6+
}, resolve: {
107
fallback: {"events": require.resolve("events/")}
11-
}
8+
}, optimization: {
9+
minimize: true
10+
},
1211
};
1312

1413

scripts/build-wasm-server.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
pushd server
6+
wasm-pack build --target nodejs
7+
sed -i 's#"name": "server"#"name": "@clash/server"#' pkg/package.json
8+
popd
9+
10+
echo "Done!"

scripts/publish-server.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
VERSION=$1
6+
if [ -z "$VERSION" ]; then
7+
echo "Usage: $0 <version>"
8+
exit 1
9+
fi
10+
11+
echo "Building server..."
12+
./scripts/build-wasm-server.sh
13+
14+
echo "Publishing server..."
15+
pushd server
16+
wasm-pack publish --access public --tag "$VERSION"
17+
popd
18+
19+
echo "Done!"

server/Cargo.toml

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
name = "server"
33
version = "0.1.0"
44
edition = "2021"
5+
license = "MIT"
6+
repository = "[email protected]:boardgamers/clash.git"
7+
homepage = "https://www.boardgamers.space/"
8+
description = "A server for Clash of Cultures"
9+
510

611
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
712

server/build-wasm.sh

-7
This file was deleted.

0 commit comments

Comments
 (0)