Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
Implement github actions to build & test bindings on Windows and uplo…
Browse files Browse the repository at this point in the history
…ad (#411)

prebuilds on creating a new release
  • Loading branch information
Jikstra committed Jan 24, 2020
1 parent 79ae7f7 commit 0e0751f
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 63 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build_and_test-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build & Test (Windows)
on: [push]

jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare
run: |
rustc -vV
rustup -vV
cargo -vV
npm --version
node --version
- name: Pull submodule
run: npm run submodule

- name: Cache node modules
uses: actions/cache@v1
with:
path: ${{ env.APPDATA }}/npm-cache # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.os }}-node-3-${{ hashFiles('**/package.json') }}

- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-2-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-2-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo build
uses: actions/cache@v1
with:
path: deltachat-core-rust/target
key: ${{ runner.os }}-cargo-2-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: Install
if: steps.cache.outputs.cache-hit != 'true'
run: npm install --verbose
- name: Test
run: |
npm run test
67 changes: 67 additions & 0 deletions .github/workflows/prebuild-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Prebuild (Windows)
on:
release:
types: [created]

jobs:
prebuild-windows:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare
run: |
rustc -vV
rustup -vV
cargo -vV
npm --version
node --version
- name: Pull submodule
run: npm run submodule

- name: Cache node modules
uses: actions/cache@v1
with:
path: ${{ env.APPDATA }}/npm-cache # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.os }}-node-3-${{ hashFiles('**/package.json') }}

- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-2-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-2-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo build
uses: actions/cache@v1
with:
path: deltachat-core-rust/target
key: ${{ runner.os }}-cargo-2-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: Install
if: steps.cache.outputs.cache-hit != 'true'
run: npm install --verbose
- name: Test
run: |
npm run test
- name: Build Prebuild
run: |
SET ARCHIVE_NAME=%GITHUB_REF%-win32-x64.tar.gz
npm run prebuild
tar -zcvf "%ARCHIVE_NAME%" -C prebuilds .
- name: Upload Prebuild
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ ARCHIVE_NAME }}
asset_name: ${{ ARCHIVE_NAME }}
tag: ${{ github.ref }}
overwrite: true
48 changes: 0 additions & 48 deletions appveyor.yml

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"coverage": "nyc report --reporter=text-lcov | coveralls",
"coverage-html-report": "rm -rf coverage/ && nyc report --reporter=html && opn coverage/index.html",
"generate-constants": "./scripts/generate-constants.js",
"install": "node scripts/install.js",
"node-gyp-build": "npx node-gyp-build \"node scripts/rebuild-core.js\" \"node scripts/postinstall.js\"",
"install": "node node_modules/node-gyp-build/bin.js \"node scripts/rebuild-core.js\" \"node scripts/postinstall.js\"",
"rebuild-all": "npm run rebuild-core && npm run rebuild-bindings",
"rebuild-core": "node scripts/rebuild-core.js",
"rebuild-bindings": "npx node-gyp rebuild && npm run generate-constants",
Expand Down
13 changes: 0 additions & 13 deletions scripts/install.js

This file was deleted.

0 comments on commit 0e0751f

Please sign in to comment.