Skip to content
This repository was archived by the owner on Mar 23, 2021. It is now read-only.

Commit 94af839

Browse files
Make it work on windows 🎉
1 parent 05ff59b commit 94af839

File tree

21 files changed

+472
-153
lines changed

21 files changed

+472
-153
lines changed

.github/workflows/CI.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ jobs:
5555
toolchain: ${{ env.RUST_TOOLCHAIN }}
5656
override: true
5757

58+
- name: Install OpenSSL and configure it to link statically
59+
run: |
60+
vcpkg install openssl:x64-windows-static
61+
vcpkg integrate install
62+
echo "::set-env name=RUSTFLAGS::-Ctarget-feature=+crt-static"
63+
if: matrix.os == 'windows'
64+
5865
- name: Build ${{ matrix.os }} binary
5966
run: make build
6067

@@ -103,4 +110,4 @@ jobs:
103110
cd .npm
104111
yarn install
105112
yarn list
106-
yarn test
113+
yarn test

.github/workflows/release-bin.yml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,46 @@ on:
77
- '[0-9]+.[0-9]+.[0-9]+'
88

99
jobs:
10-
build:
11-
name: Rust project
12-
runs-on: ${{ matrix.os }}
10+
rust_build:
1311
strategy:
1412
matrix:
15-
os: [ubuntu-latest, macOS-latest]
13+
os: [macos, windows, ubuntu]
14+
include:
15+
- os: windows
16+
binary: create-comit-app.exe
17+
- os: ubuntu
18+
binary: create-comit-app
19+
- os: macos
20+
binary: create-comit-app
21+
runs-on: ${{ matrix.os }}-latest
1622
steps:
17-
- uses: actions/checkout@master
18-
# Workaround until actions/virtual-environments#6 is fixed
19-
- name: Get Toolchain version
20-
if: startsWith(matrix.os, 'macOS')
21-
run: |
22-
echo ::set-env name=TOOLCHAIN::$(cat rust-toolchain|head -n1)
23-
- name: Install Rust
24-
if: startsWith(matrix.os, 'macOS')
23+
- name: Checkout sources
24+
uses: actions/checkout@v1
25+
26+
- name: Extract toolchain version from rust-toolchain
27+
run: echo "::set-env name=RUST_TOOLCHAIN::$(cat rust-toolchain)"
28+
29+
- name: Install ${{ env.RUST_TOOLCHAIN }} toolchain
2530
uses: actions-rs/toolchain@v1
2631
with:
27-
toolchain: ${{ env.TOOLCHAIN }}
28-
- name: Build release
29-
uses: actions-rs/cargo@v1
30-
with:
31-
command: build
32-
args: --release --all-features
33-
- name: Create archive
34-
if: startsWith(github.ref, 'refs/tags/')
32+
profile: minimal
33+
toolchain: ${{ env.RUST_TOOLCHAIN }}
34+
override: true
35+
36+
- name: Install OpenSSL and configure it to link statically
3537
run: |
36-
VERSION=${GITHUB_REF##*/};
37-
(cd ./target/release; tar czvf ~/create-comit-app_${VERSION}_$(uname -s)_$(uname -m).tar.gz create-comit-app;)
38-
mv ~/create-comit-app_*.tar.gz .
39-
- name: Upload asset
40-
uses: softprops/action-gh-release@v1
41-
if: startsWith(github.ref, 'refs/tags/')
42-
with:
43-
files: create-comit-app_*.tar.gz
44-
env:
45-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
vcpkg install openssl:x64-windows-static
39+
vcpkg integrate install
40+
echo "::set-env name=RUSTFLAGS::-Ctarget-feature=+crt-static"
41+
if: matrix.os == 'windows'
42+
43+
- name: Build ${{ matrix.os }} release binary
44+
run: make release
45+
4646
npm_build:
4747
name: NPM Project
4848
runs-on: ubuntu-latest
49-
needs: build # Do not publish if the build failed
49+
needs: rust_build # Do not publish if the build failed
5050
steps:
5151
- uses: actions/checkout@v1
5252
- name: Use Node.js 10.x
@@ -66,4 +66,4 @@ jobs:
6666
cd .npm
6767
yarn publish
6868
env:
69-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
69+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## Unreleased
88

9+
## Added
10+
- Windows support :tada:.
11+
912
## [0.5.2] - 2019-12-06
1013

1114
## Changed

Cargo.lock

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

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ futures-preview = { version = "0.3.0-alpha.19", features = ["compat"] }
1717
hex = "0.4.0"
1818
hex-literal = "0.2.1"
1919
hex-serde = "0.1.0"
20+
http = "0.1"
2021
lazy_static = "1.4"
2122
reqwest = { version = "0.9", default-features = false }
2223
rust_bitcoin = { version = "0.19.1", package = "bitcoin" }
@@ -34,10 +35,13 @@ toml = "0.5"
3435
web3 = { version = "0.8", default-features = false, features = ["http"] }
3536

3637
[features]
37-
default = ["shiplift/unix-socket"]
38+
default = ["unix"]
39+
unix = ["shiplift/unix-socket"]
40+
windows = ["shiplift/tls"]
3841

3942
[build-dependencies]
4043
anyhow = "1.0.25"
4144
flate2 = "1.0.13"
4245
ignore = "0.4.10"
4346
tar = "0.4.26"
47+

0 commit comments

Comments
 (0)