Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
CMCDragonkai committed May 26, 2022
1 parent b446e46 commit 7b69ba9
Show file tree
Hide file tree
Showing 10 changed files with 1,916 additions and 25 deletions.
90 changes: 90 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,51 @@ build:macos:
# Runs on tag pipeline where the tag is a prerelease or release version
- if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/

build:prerelease:
stage: build
needs:
- build:linux
- build:windows
- build:macos
# Don't interrupt publishing job
interruptible: false
before_script:
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ./.npmrc
script:
- echo 'Publishing library prerelease'
- >
nix-shell --run '
npm publish --tag prerelease --access public;
'
- >
for d in prebuilds/*; do
tar \
--create \
--verbose \
--file="prebuilds/$(basename $d).tar" \
--directory=prebuilds \
"$(basename $d)";
done
- >
nix-shell -I nixpkgs=./pkgs.nix --packages gitAndTools.gh --run '
gh release \
create "$CI_COMMIT_TAG" \
prebuilds/*.tar \
--title "${CI_COMMIT_TAG}-$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
--notes "" \
--prerelease \
--target staging \
--repo "$GH_PROJECT_PATH";
'
after_script:
- rm -f ./.npmrc
rules:
# Only runs on tag pipeline where the tag is a prerelease version
# This requires dependencies to also run on tag pipeline
# However version tag comes with a version commit
# Dependencies must not run on the version commit
- if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+-.*[0-9]+$/

integration:merge:
stage: integration
needs:
Expand Down Expand Up @@ -229,3 +274,48 @@ integration:merge:
- if: $CI_COMMIT_BRANCH == 'staging' && $CI_COMMIT_TITLE !~ /^[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
# Runs on tag pipeline where the tag is a prerelease or release version
- if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/

release:distribution:
stage: release
needs:
- build:linux
- build:windows
- build:macos
- integration:merge
# Don't interrupt publishing job
interruptible: false
before_script:
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ./.npmrc
script:
- echo 'Publishing library'
- >
nix-shell --run '
npm publish --access public;
'
- >
for d in prebuilds/*; do
tar \
--create \
--verbose \
--file="prebuilds/$(basename $d).tar" \
--directory=prebuilds \
"$(basename $d)";
done
- >
nix-shell -I nixpkgs=./pkgs.nix --packages gitAndTools.gh --run '
gh release \
create "$CI_COMMIT_TAG" \
prebuilds/*.tar \
--title "${CI_COMMIT_TAG}-$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
--notes "" \
--target master \
--repo "$GH_PROJECT_PATH";
'
after_script:
- rm -f ./.npmrc
rules:
# Only runs on tag pipeline where the tag is a release version
# This requires dependencies to also run on tag pipeline
# However version tag comes with a version commit
# Dependencies must not run on the version commit
- if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/
42 changes: 42 additions & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
'targets': [{
'target_name': 'native',
'include_dirs': [
"<!(node -e \"require('napi-macros')\")"
],
'sources': ['./src/native/index.c'],
'conditions': [
['OS=="linux"', {
'cflags': [ '-std=c99', '-Wpedantic' ],
'cflags_cc': [ '-std=c++17', '-Wpedantic' ],
}],
['OS=="win"', {
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': [ '/std:c++17' ]
}
},
}],
['OS=="mac"', {
'xcode_settings': {
# Minimum mac osx target version (matches node v16.14.2)
'MACOSX_DEPLOYMENT_TARGET': '10.13',
'OTHER_CFLAGS': [
'-std=c99',
'-arch x86_64',
'-arch arm64'
],
'OTHER_CPLUSPLUSFLAGS': [
'-std=c++17'
'-arch x86_64',
'-arch arm64'
],
'OTHER_LDFLAGS': [
'-arch x86_64',
'-arch arm64'
]
}
}]
]
}]
}
Loading

0 comments on commit 7b69ba9

Please sign in to comment.