Skip to content

Commit

Permalink
Merge pull request #29 from unknownskl/feature/native-typescript
Browse files Browse the repository at this point in the history
Native Typescript implementation
  • Loading branch information
unknownskl committed Nov 30, 2023
2 parents f0a53c6 + 6160eb3 commit 97fe5ba
Show file tree
Hide file tree
Showing 20 changed files with 872 additions and 3,385 deletions.
36 changes: 2 additions & 34 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,46 +33,14 @@ jobs:
with:
node-version: 18

- run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
if: runner.os == 'Windows'
- run: vcpkg install openssl:x64-windows-static-md
if: runner.os == 'Windows'

- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ runner.arch }}-cargo-

# Setup package dependencies
- name: Install npm dependencies
run: npm ci

- name: Build project
run: npm run build

- name: Run cargo tests
run: npm run test

- name: Run NodeJS Tests
run: npm run nodetest

- name: Package the asset
run: npx @mapbox/node-pre-gyp package

- name: Publish Artifact
uses: actions/upload-artifact@v3
with:
name: xal-node
path: |
build/stage/*/*.tar.gz
- name: Run NodeJS Tests
run: npm run test

- name: Set release version
run: python3 -c "import os; tag = os.environ['GITHUB_REF'].split('/')[-1]; f = open(os.environ['GITHUB_ENV'], 'a'); f.write('RELEASE_VERSION='+tag); f.close();"
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: NPM Publish

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
# the Node.js versions to build on
node-version: [18.x]

steps:
- uses: actions/checkout@v3.6.0
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo

- name: Get tag name
id: tag_name
run: |
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- name: Install dependencies
run: npm ci

- name: Build the project
run: npm run build

- name: Run NodeJS Tests
run: npm run test

- name: NPM publish beta package
if: ${{ contains(steps.tag_name.outputs.SOURCE_TAG, 'beta') }}
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
tag: beta

- name: NPM publish package
if: ${{ !contains(steps.tag_name.outputs.SOURCE_TAG, 'beta') }}
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

Loading

0 comments on commit 97fe5ba

Please sign in to comment.