-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
- Loading branch information
Showing
118 changed files
with
3,870 additions
and
8,679 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: 'build-napi-artifact' | ||
description: | | ||
Builds napi artifact using specified settings' | ||
inputs: | ||
docker: | ||
required: true | ||
target: | ||
required: true | ||
build: | ||
required: true | ||
node-version: | ||
default: 18 | ||
rust-version: | ||
default: 1.64.0 | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
if: ${{ !inputs.docker }} | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
cache: npm | ||
cache-dependency-path: ${{ github.workspace }}/wrappers/vcx-napi-rs/package-lock.json | ||
- name: Install | ||
uses: actions-rs/toolchain@v1 | ||
if: ${{ !inputs.docker }} | ||
with: | ||
toolchain: ${{ inputs.rust-version }} | ||
target: ${{ inputs.target }} | ||
default: true | ||
- name: Cache cargo | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
.cargo-cache | ||
target/ | ||
key: ${{ inputs.target }}-cargo-registry | ||
- name: Install dependencies | ||
run: npm install | ||
working-directory: ${{ github.workspace }}/wrappers/vcx-napi-rs | ||
shell: bash | ||
- name: Build in docker | ||
uses: addnab/docker-run-action@v3 | ||
if: ${{ inputs.docker }} | ||
with: | ||
image: ${{ inputs.docker }} | ||
options: -v /home/runner/.cargo/git/db:/root/.cargo/git/db -v /home/runner/.cargo/registry/cache:/root/.cargo/registry/cache -v /home/runner/.cargo/registry/index:/root/.cargo/registry/index -v ${{ github.workspace }}:/build -w /build | ||
run: ${{ inputs.build }} | ||
- name: Build | ||
run: ${{ inputs.build }} | ||
if: ${{ !inputs.docker }} | ||
working-directory: ${{ github.workspace }}/wrappers/vcx-napi-rs | ||
shell: bash | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: bindings-${{ inputs.target }} | ||
path: ${{ github.workspace }}/wrappers/vcx-napi-rs/*.node | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: 'publish-napi' | ||
description: | | ||
Publishes vcx-napi-rs node packages | ||
inputs: | ||
publish-version: | ||
required: true | ||
npmjs-token: | ||
required: true | ||
node-version: | ||
default: 18 | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
cache: npm | ||
cache-dependency-path: ${{ github.workspace }}/wrappers/vcx-napi-rs/package-lock.json | ||
- name: Install dependencies | ||
run: npm install | ||
working-directory: ${{ github.workspace }}/wrappers/vcx-napi-rs | ||
shell: bash | ||
- name: Download napi artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: ${{ github.workspace }}/wrappers/vcx-napi-rs/artifacts | ||
- name: Move artifacts | ||
run: | | ||
find . -type d -not -path \*\*/artifacts/bindings-\* -path \*\*/artifacts/\*\* -mindepth 2 -maxdepth 2 -exec rm -rf {} \+ | ||
ls -R artifacts | ||
npm run artifacts | ||
working-directory: ${{ github.workspace }}/wrappers/vcx-napi-rs | ||
shell: bash | ||
- name: Publish | ||
run: | | ||
if [[ "$PUBLISH_VERSION" ]] | ||
then | ||
npm set "//registry.npmjs.org/:_authToken" $NPMJS_TOKEN | ||
npm version $PUBLISH_VERSION | ||
npm run prepublish | ||
npm publish | ||
else | ||
echo "New version was not defined, skipping release." | ||
fi | ||
working-directory: ${{ github.workspace }}/wrappers/vcx-napi-rs | ||
shell: bash | ||
env: | ||
NPMJS_TOKEN: ${{ inputs.npmjs-token }} | ||
PUBLISH_VERSION: ${{ inputs.publish-version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.