blindly copying deltachat-node to core repository

This commit is contained in:
missytake
2022-05-02 18:56:37 +02:00
committed by Simon Laux
parent 961612370d
commit a786a1427d
48 changed files with 10343 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
name: 'Linux'
on: push
jobs:
build-and-test:
name: "Build & Test integration"
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: System info
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-${{ hashFiles('**/package.json') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: deltachat-core-rust/target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm install --ignore-scripts --verbose
- name: Build deltachat-core-rust & bindings
if: steps.cache.outputs.cache-hit != 'true'
run: npm run build
- name: Tests (+ Integration tests)
run: npm run test
env:
DCC_NEW_TMP_EMAIL: ${{secrets.DCC_NEW_TMP_EMAIL}}

View File

@@ -0,0 +1,52 @@
name: 'Build & Test'
on: push
jobs:
build-and-test:
name: 'Build & Test'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: System info
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-${{ hashFiles('**/package.json') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: |
~/.cargo/registry/
~/.cargo/git
deltachat-core-rust/target
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}-2
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm install --ignore-scripts --verbose
- name: Build deltachat-core-rust & bindings
if: steps.cache.outputs.cache-hit != 'true'
run: npm run build
- name: Test
run: npm run test

124
node/.github/workflows/make-package.yml vendored Normal file
View File

@@ -0,0 +1,124 @@
name: 'Make Package'
on: push
jobs:
prebuild:
name: 'Prebuild'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: System info
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@v2
with:
path: |
${{ env.APPDATA }}/npm-cache
~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: |
~/.cargo/registry/
~/.cargo/git
deltachat-core-rust/target
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}-2
- name: Install dependencies & build
if: steps.cache.outputs.cache-hit != 'true'
run: npm install --verbose
- name: Build Prebuild
run: |
npm run prebuildify
tar -zcvf "${{ matrix.os }}.tar.gz" -C prebuilds .
- name: Upload Prebuild
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.os }}
path: ${{ matrix.os }}.tar.gz
pack-module:
needs: prebuild
name: 'Package the node_module and upload as artifact for testing'
runs-on: ubuntu-18.04
steps:
- name: install tree
run: sudo apt install tree
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: System info
run: |
rustc -vV
rustup -vV
cargo -vV
npm --version
node --version
- name: npm run submodule
run: npm run submodule
- name: Download ubuntu prebuild
uses: actions/download-artifact@v1
with:
name: ubuntu-18.04
- name: Download macos prebuild
uses: actions/download-artifact@v1
with:
name: macos-latest
- name: Download windows prebuild
uses: actions/download-artifact@v1
with:
name: windows-latest
- shell: bash
run: |
ls -lah
mkdir prebuilds
tar -xvzf ubuntu-18.04/ubuntu-18.04.tar.gz -C prebuilds
tar -xvzf macos-latest/macos-latest.tar.gz -C prebuilds
tar -xvzf windows-latest/windows-latest.tar.gz -C prebuilds
tree prebuilds
- name: install dependencies without running scripts
run: npm install --ignore-scripts
- name: build typescript part
run: npm run build:bindings:ts
- name: package
shell: bash
run: |
npm pack .
ls -lah
mv $(find deltachat-node-*) deltachat-node.tgz
- name: Upload Prebuild
uses: actions/upload-artifact@v1
with:
name: deltachat-node.tgz
path: deltachat-node.tgz
- name: Upload to release
if: contains(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: deltachat-node.tgz
asset_name: deltachat-node.tgz
tag: ${{ github.ref }}
overwrite: true

33
node/.github/workflows/upload-docs.yaml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: Generate & upload documentation
on:
push:
branches:
- master
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: npm install and generate documentation
run: |
npm i --ignore-scripts
npx typedoc
mv docs js
- name: Upload
uses: horochx/deploy-via-scp@v1.0.1
with:
user: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
host: "delta.chat"
port: 22
local: "js"
remote: "/var/www/html/"