Files
chatmail-core/.github/workflows/node-package.yml
missytake e9511ebfc3 first steps to integrate deltachat-node to core repository, adjust CI:
adjust scripts to new location of deltachat-core-rust
adjust dc-node readme to repo change
mention old repository
migrate github actions, try out if they work
fix path to node docs in SSH github action
passing mailadm token to node tests
hopefully fixing the download paths for the artifacts
fixing download paths, this time for real
post upload link to details
fix scp command
forgot to remove platform_status dict
fixing paths in the github action
add github action to delete node preview builds when PR is closed
move environment variable to yaml
remove git trash
github action to release to npm
use different action which also works with branches for testing
we don't want to publish to NPM through the CI
see what lint issues windows has
2022-05-13 21:25:35 +02:00

144 lines
4.1 KiB
YAML

name: 'Build node.js bindings from PR'
on:
pull_request:
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: 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
target
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}-2
- name: Install dependencies & build
if: steps.cache.outputs.cache-hit != 'true'
run: |
cd node
npm install --verbose
- name: Build Prebuild
run: |
cd node
npm run prebuildify
tar -zcvf "${{ matrix.os }}.tar.gz" -C prebuilds .
- name: Upload Prebuild
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.os }}
path: node/${{ 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: Get Pullrequest ID
id: prepare
run: |
node -e "console.log('::set-output name=prid::' + '${{ github.ref }}'.split('/')[2])"
- name: System info
run: |
rustc -vV
rustup -vV
cargo -vV
npm --version
node --version
- name: Download ubuntu prebuild
uses: actions/download-artifact@v1
with:
name: ubuntu-18.04
path: node/
- name: Download macos prebuild
uses: actions/download-artifact@v1
with:
name: macos-latest
path: node/
- name: Download windows prebuild
uses: actions/download-artifact@v1
with:
name: windows-latest
path: node/
- shell: bash
run: |
cd node
ls -lah
mkdir prebuilds
tar -xvzf ubuntu-18.04.tar.gz -C prebuilds
tar -xvzf macos-latest.tar.gz -C prebuilds
tar -xvzf windows-latest.tar.gz -C prebuilds
tree prebuilds
- name: install dependencies without running scripts
run: |
cd node
npm install --ignore-scripts
- name: build typescript part
run: |
cd node
npm run build:bindings:ts
- name: package
shell: bash
run: |
cd node
npm pack .
ls -lah
mv $(find deltachat-node-*) deltachat-node-${{ steps.prepare.outputs.prid }}.tar.gz
- name: Upload Prebuild
uses: actions/upload-artifact@v1
with:
name: deltachat-node.tgz
path: node/deltachat-node-${{ steps.prepare.outputs.prid }}.tar.gz
# Upload Step
- name: upload folder
id: upload
shell: bash
run: |
cd node
echo -e "${{ secrets.SSH_KEY }}" >__TEMP_INPUT_KEY_FILE
chmod 600 __TEMP_INPUT_KEY_FILE
scp -o StrictHostKeyChecking=no -v -i __TEMP_INPUT_KEY_FILE -P "22" -r deltachat-node-${{ steps.prepare.outputs.prid }}.tar.gz "${{ secrets.USERNAME }}"@"download.delta.chat":"/var/www/html/download/node/"
continue-on-error: true
- name: "Post links to details"
if: steps.upload.outcome == 'success'
run: node ./node/scripts/postLinksToDetails.js
env:
PR_ID: ${{ steps.prepare.outputs.prid }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}