Compare commits

...

41 Commits

Author SHA1 Message Date
Derrick Hammer 22d9487d19
refactor: need to move dir check and TEMPLATES const inside function 2023-06-25 17:11:52 -04:00
Derrick Hammer bdd2b66725
fix: add @ts-ignore to import.meta.url 2023-06-25 17:09:20 -04:00
Derrick Hammer 4761259c9c
Merge remote-tracking branch 'origin/develop' into develop 2023-06-25 17:08:40 -04:00
Derrick Hammer 847ade399f
refactor: move dir check to separate file to be dynamically loaded if esm 2023-06-25 17:08:35 -04:00
semantic-release-bot 66bc3ddb51 chore(release): 0.1.1-develop.12 [skip ci]
## [0.1.1-develop.12](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.11...v0.1.1-develop.12) (2023-06-25)

### Bug Fixes

* add __dirname compatibility ([60f45cb](60f45cb8d5))
* switch to hybrid building ([7a58630](7a58630cda))
2023-06-25 20:59:19 +00:00
Derrick Hammer 60f45cb8d5
fix: add __dirname compatibility 2023-06-25 16:58:29 -04:00
Derrick Hammer a5f166210d
Merge remote-tracking branch 'origin/develop' into develop 2023-06-25 16:54:04 -04:00
Derrick Hammer 7a58630cda
fix: switch to hybrid building 2023-06-25 16:53:58 -04:00
semantic-release-bot 458cccc4cb chore(release): 0.1.1-develop.11 [skip ci]
## [0.1.1-develop.11](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.10...v0.1.1-develop.11) (2023-06-25)

### Bug Fixes

* add .releaserc.json to gitignore ([a892d35](a892d3557e))
2023-06-25 09:25:40 +00:00
Derrick Hammer 1b14cdbf5d
Merge remote-tracking branch 'origin/develop' into develop 2023-06-25 05:25:02 -04:00
Derrick Hammer a892d3557e
fix: add .releaserc.json to gitignore 2023-06-25 05:24:58 -04:00
semantic-release-bot d24f783ce6 chore(release): 0.1.1-develop.10 [skip ci]
## [0.1.1-develop.10](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.9...v0.1.1-develop.10) (2023-06-25)

### Bug Fixes

* add dom to ts compiler ([c3c172a](c3c172a5bc))
2023-06-25 09:20:13 +00:00
Derrick Hammer 470ff93fee
Merge remote-tracking branch 'origin/develop' into develop 2023-06-25 05:19:29 -04:00
Derrick Hammer c3c172a5bc
fix: add dom to ts compiler 2023-06-25 05:19:23 -04:00
semantic-release-bot e1703a7608 chore(release): 0.1.1-develop.9 [skip ci]
## [0.1.1-develop.9](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.8...v0.1.1-develop.9) (2023-06-25)

### Bug Fixes

* don't let presetter try to parse the file ([7bb0961](7bb0961885))
2023-06-25 09:13:39 +00:00
Derrick Hammer 26f6013869
Merge remote-tracking branch 'origin/develop' into develop 2023-06-25 05:13:01 -04:00
Derrick Hammer 7bb0961885
fix: don't let presetter try to parse the file 2023-06-25 05:12:57 -04:00
semantic-release-bot fd63b9d814 chore(release): 0.1.1-develop.8 [skip ci]
## [0.1.1-develop.8](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.7...v0.1.1-develop.8) (2023-06-25)

### Bug Fixes

* releaserc missing from templates ([0ba3e5e](0ba3e5e5f5))
* syntax error ([7bba835](7bba8356e0))
2023-06-25 09:00:59 +00:00
Derrick Hammer 0ba3e5e5f5
fix: releaserc missing from templates 2023-06-25 04:59:59 -04:00
Derrick Hammer 7bba8356e0
fix: syntax error 2023-06-25 04:59:45 -04:00
semantic-release-bot 71e10d2d74 chore(release): 0.1.1-develop.7 [skip ci]
## [0.1.1-develop.7](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.6...v0.1.1-develop.7) (2023-06-25)

### Bug Fixes

* add ES2021 to ts compiler ([c15b279](c15b279d63))

### Reverts

* Revert "fix: add ES2021 to ts compiler" ([2183387](2183387a3f))
2023-06-25 08:54:43 +00:00
Derrick Hammer c481026b98
Merge remote-tracking branch 'origin/develop' into develop 2023-06-25 04:54:01 -04:00
Derrick Hammer c15b279d63
fix: add ES2021 to ts compiler 2023-06-25 04:53:56 -04:00
Derrick Hammer 2183387a3f
Revert "fix: add ES2021 to ts compiler"
This reverts commit f1e60e5437.
2023-06-25 04:53:26 -04:00
semantic-release-bot 7c5c00e0c9 chore(release): 0.1.1-develop.6 [skip ci]
## [0.1.1-develop.6](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.5...v0.1.1-develop.6) (2023-06-25)

### Bug Fixes

* add ES2021 to ts compiler ([f1e60e5](f1e60e5437))
2023-06-25 08:51:55 +00:00
Derrick Hammer 4c0f9483d5
Merge remote-tracking branch 'origin/develop' into develop 2023-06-25 04:51:05 -04:00
Derrick Hammer f1e60e5437
fix: add ES2021 to ts compiler 2023-06-25 04:51:01 -04:00
semantic-release-bot 40ce399216 chore(release): 0.1.1-develop.5 [skip ci]
## [0.1.1-develop.5](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.4...v0.1.1-develop.5) (2023-06-25)

### Bug Fixes

* dont symlink ci file ([87afb2c](87afb2cc64))
2023-06-25 08:29:32 +00:00
Derrick Hammer a2d1751cbb
Merge remote-tracking branch 'origin/develop' into develop 2023-06-25 04:28:34 -04:00
Derrick Hammer 87afb2cc64
fix: dont symlink ci file 2023-06-25 04:28:29 -04:00
semantic-release-bot ce9851fd2f chore(release): 0.1.1-develop.4 [skip ci]
## [0.1.1-develop.4](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.3...v0.1.1-develop.4) (2023-06-25)

### Bug Fixes

* add missing files property ([7a1e88e](7a1e88e8dc))
2023-06-25 08:19:40 +00:00
Derrick Hammer 7812e423df
Merge remote-tracking branch 'origin/develop' into develop 2023-06-25 04:18:41 -04:00
Derrick Hammer 7a1e88e8dc
fix: add missing files property 2023-06-25 04:18:36 -04:00
semantic-release-bot b6fe5e7463 chore(release): 0.1.1-develop.3 [skip ci]
## [0.1.1-develop.3](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.2...v0.1.1-develop.3) (2023-06-25)

### Bug Fixes

* add missing type and main ([9f0cdc2](9f0cdc22b6))
2023-06-25 08:05:37 +00:00
Derrick Hammer b15e8b4750
Merge remote-tracking branch 'origin/develop' into develop 2023-06-25 04:04:58 -04:00
Derrick Hammer 9f0cdc22b6
fix: add missing type and main 2023-06-25 04:04:53 -04:00
semantic-release-bot 03ed414b8e chore(release): 0.1.1-develop.2 [skip ci]
## [0.1.1-develop.2](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.1...v0.1.1-develop.2) (2023-06-25)

### Bug Fixes

* remove peer deps ([23ada98](23ada98337))
2023-06-25 08:00:51 +00:00
Derrick Hammer e1c5d34677
Merge remote-tracking branch 'origin/develop' into develop 2023-06-25 04:00:15 -04:00
Derrick Hammer 23ada98337
fix: remove peer deps 2023-06-25 04:00:08 -04:00
semantic-release-bot 588cf0089f chore(release): 0.1.1-develop.1 [skip ci]
## [0.1.1-develop.1](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.0...v0.1.1-develop.1) (2023-06-25)
2023-06-25 07:49:44 +00:00
Derrick Hammer 13671f5970
refactor: switch to github actions 2023-06-25 03:48:46 -04:00
11 changed files with 221 additions and 68 deletions

View File

@ -1,6 +1,7 @@
{
"preset": [
"presetter-preset-strict"
"presetter-preset-strict",
"presetter-preset-hybrid"
],
"config": {
"prettier": {

View File

@ -1,3 +1,89 @@
## [0.1.1-develop.12](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.11...v0.1.1-develop.12) (2023-06-25)
### Bug Fixes
* add __dirname compatibility ([60f45cb](https://git.lumeweb.com/LumeWeb/node-library-preset/commit/60f45cb8d544de3c77be90359bdce9ea98422040))
* switch to hybrid building ([7a58630](https://git.lumeweb.com/LumeWeb/node-library-preset/commit/7a58630cdaf69e9830a03ca7c2bc6fecd188a2f0))
## [0.1.1-develop.11](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.10...v0.1.1-develop.11) (2023-06-25)
### Bug Fixes
* add .releaserc.json to gitignore ([a892d35](https://git.lumeweb.com/LumeWeb/node-library-preset/commit/a892d3557ee419725cae6ce9f35293d98b6719e4))
## [0.1.1-develop.10](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.9...v0.1.1-develop.10) (2023-06-25)
### Bug Fixes
* add dom to ts compiler ([c3c172a](https://git.lumeweb.com/LumeWeb/node-library-preset/commit/c3c172a5bcd878fde5b368f7aa4050cced7971af))
## [0.1.1-develop.9](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.8...v0.1.1-develop.9) (2023-06-25)
### Bug Fixes
* don't let presetter try to parse the file ([7bb0961](https://git.lumeweb.com/LumeWeb/node-library-preset/commit/7bb09618851891d64b320c4651c545e097d8479d))
## [0.1.1-develop.8](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.7...v0.1.1-develop.8) (2023-06-25)
### Bug Fixes
* releaserc missing from templates ([0ba3e5e](https://git.lumeweb.com/LumeWeb/node-library-preset/commit/0ba3e5e5f5ef3fc790a75ff9f8fffb431042bcd1))
* syntax error ([7bba835](https://git.lumeweb.com/LumeWeb/node-library-preset/commit/7bba8356e0ecaa426bb3afcc984607bf21a5474f))
## [0.1.1-develop.7](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.6...v0.1.1-develop.7) (2023-06-25)
### Bug Fixes
* add ES2021 to ts compiler ([c15b279](https://git.lumeweb.com/LumeWeb/node-library-preset/commit/c15b279d637ac5d76b8d42f1ec83403a9dcf721c))
### Reverts
* Revert "fix: add ES2021 to ts compiler" ([2183387](https://git.lumeweb.com/LumeWeb/node-library-preset/commit/2183387a3fa4b36528db7b9d4236433114b486e4))
## [0.1.1-develop.6](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.5...v0.1.1-develop.6) (2023-06-25)
### Bug Fixes
* add ES2021 to ts compiler ([f1e60e5](https://git.lumeweb.com/LumeWeb/node-library-preset/commit/f1e60e54371c3c7505d2bb191792a211b57ba591))
## [0.1.1-develop.5](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.4...v0.1.1-develop.5) (2023-06-25)
### Bug Fixes
* dont symlink ci file ([87afb2c](https://git.lumeweb.com/LumeWeb/node-library-preset/commit/87afb2cc64344dba11c06c4c73ab245547a383a6))
## [0.1.1-develop.4](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.3...v0.1.1-develop.4) (2023-06-25)
### Bug Fixes
* add missing files property ([7a1e88e](https://git.lumeweb.com/LumeWeb/node-library-preset/commit/7a1e88e8dc483e50a26eb5a85daf7e42413a0ba3))
## [0.1.1-develop.3](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.2...v0.1.1-develop.3) (2023-06-25)
### Bug Fixes
* add missing type and main ([9f0cdc2](https://git.lumeweb.com/LumeWeb/node-library-preset/commit/9f0cdc22b635475aa025cdac656e0c31db370af3))
## [0.1.1-develop.2](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.1-develop.1...v0.1.1-develop.2) (2023-06-25)
### Bug Fixes
* remove peer deps ([23ada98](https://git.lumeweb.com/LumeWeb/node-library-preset/commit/23ada9833711bb1beeed435a0d7960b13da8ba92))
## [0.1.1-develop.1](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.1.0...v0.1.1-develop.1) (2023-06-25)
# [0.1.0](https://git.lumeweb.com/LumeWeb/node-library-preset/compare/v0.0.1...v0.1.0) (2023-06-25)

View File

@ -1,22 +1,40 @@
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
const DIR = dirname(fileURLToPath(import.meta.url));
const TEMPLATES = resolve(DIR, "..", "templates");
export const DEFAULT_VARIABLE = {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT_VARIABLE = void 0;
const node_path_1 = require("node:path");
const node_url_1 = require("node:url");
let DIR;
if (typeof __dirname === "undefined") {
DIR = (0, node_path_1.dirname)((0, node_url_1.fileURLToPath)(import.meta.url));
}
else {
DIR = __dirname;
}
const TEMPLATES = (0, node_path_1.resolve)(DIR, "..", "templates");
exports.DEFAULT_VARIABLE = {
source: "src",
};
export default async function () {
async function default_1() {
return {
extends: ["presetter-preset-strict"],
template: {
".circleci/config.yml": resolve(TEMPLATES, "circleci.yml"),
".github/workflows/ci.yml": (0, node_path_1.resolve)(TEMPLATES, "ci.yml.raw"),
".releaserc.json": (0, node_path_1.resolve)(TEMPLATES, ".releaserc.json"),
},
variable: DEFAULT_VARIABLE,
noSymlinks: [".github/workflows/ci.yml"],
variable: exports.DEFAULT_VARIABLE,
supplementaryConfig: {
prettier: {
singleQuote: false,
},
gitignore: [".releaserc.json"],
tsconfig: {
compilerOptions: {
lib: ["ES2021", "dom"],
},
},
},
};
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFDN0MsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLFVBQVUsQ0FBQztBQUl6QyxNQUFNLEdBQUcsR0FBRyxPQUFPLENBQUMsYUFBYSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQztBQUdwRCxNQUFNLFNBQVMsR0FBRyxPQUFPLENBQUMsR0FBRyxFQUFFLElBQUksRUFBRSxXQUFXLENBQUMsQ0FBQztBQUNsRCxNQUFNLENBQUMsTUFBTSxnQkFBZ0IsR0FBRztJQUM5QixNQUFNLEVBQUUsS0FBSztDQUNkLENBQUM7QUFNRixNQUFNLENBQUMsT0FBTyxDQUFDLEtBQUs7SUFDbEIsT0FBTztRQUNMLE9BQU8sRUFBRSxDQUFDLHlCQUF5QixDQUFDO1FBQ3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JBQU8sRUFBQyxTQUFTLEVBQUUsaUJBQWlCLENBQUM7U0FDekQ7UUFDRCxVQUFVLEVBQUUsQ0FBQywwQkFBMEIsQ0FBQztRQUN4QyxRQUFRLEVBQUUsd0JBQWdCO1FBQzFCLG1CQUFtQixFQUFFO1lBQ25CLFFBQVEsRUFBRTtnQkFDUixXQUFXLEVBQUUsS0FBSzthQUNuQjtZQUNELFNBQVMsRUFBRSxDQUFDLGlCQUFpQixDQUFDO1lBQzlCLFFBQVEsRUFBRTtnQkFDUixlQUFlLEVBQUU7b0JBQ2YsR0FBRyxFQUFFLENBQUMsUUFBUSxFQUFFLEtBQUssQ0FBQztpQkFDdkI7YUFDRjtTQUNGO0tBQ0YsQ0FBQztBQUNKLENBQUM7QUFyQkQsNEJBcUJDIn0=

36
lib/index.mjs Normal file
View File

@ -0,0 +1,36 @@
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
let DIR;
if (typeof `${process.platform === 'win32' ? '' : '/'}${/file:\/{2,3}(.+)\/[^/]/.exec(import.meta.url)[1]}` === "undefined") {
DIR = dirname(fileURLToPath(import.meta.url));
}
else {
DIR = `${process.platform === 'win32' ? '' : '/'}${/file:\/{2,3}(.+)\/[^/]/.exec(import.meta.url)[1]}`;
}
const TEMPLATES = resolve(DIR, "..", "templates");
export const DEFAULT_VARIABLE = {
source: "src",
};
export default async function () {
return {
extends: ["presetter-preset-strict"],
template: {
".github/workflows/ci.yml": resolve(TEMPLATES, "ci.yml.raw"),
".releaserc.json": resolve(TEMPLATES, ".releaserc.json"),
},
noSymlinks: [".github/workflows/ci.yml"],
variable: DEFAULT_VARIABLE,
supplementaryConfig: {
prettier: {
singleQuote: false,
},
gitignore: [".releaserc.json"],
tsconfig: {
compilerOptions: {
lib: ["ES2021", "dom"],
},
},
},
};
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi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RUFBRTtnQkFDUixlQUFlLEVBQUU7b0JBQ2YsR0FBRyxFQUFFLENBQUMsUUFBUSxFQUFFLEtBQUssQ0FBQztpQkFDdkI7YUFDRjtTQUNGO0tBQ0YsQ0FBQztBQUNKLENBQUMifQ==

17
npm-shrinkwrap.json generated
View File

@ -14,11 +14,9 @@
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"presetter": "^4.0.1",
"presetter-preset-hybrid": "^4.0.1",
"presetter-preset-strict": "^4.0.1",
"semantic-release": "^21.0.5"
},
"peerDependencies": {
"presetter-preset-strict": "workspace:*"
}
},
"node_modules/@ampproject/remapping": {
@ -15130,6 +15128,19 @@
"typescript": ">=4.7.0"
}
},
"node_modules/presetter-preset-hybrid": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/presetter-preset-hybrid/-/presetter-preset-hybrid-4.0.1.tgz",
"integrity": "sha512-0GxC2QrR3cTcRQsP+PwQ+X1O2Fd/rGH2llNqI2CKePbsWZQxRT5YIsW4YsLsC82tkxhyeyrSjzjLS6hsrYf3WA==",
"dev": true,
"dependencies": {
"presetter-types": "4.0.1"
},
"peerDependencies": {
"presetter": "4.0.1",
"presetter-preset-esm": "4.0.1"
}
},
"node_modules/presetter-preset-strict": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/presetter-preset-strict/-/presetter-preset-strict-4.0.1.tgz",

View File

@ -1,6 +1,16 @@
{
"name": "@lumeweb/node-library-preset",
"version": "0.1.0",
"main": "lib/index.js",
"module": "lib/index.mjs",
"types": "lib/index.d.ts",
"exports": {
".": {
"require": "./lib/index.js",
"import": "./lib/index.mjs"
},
"./package.json": "./package.json"
},
"repository": {
"type": "git",
"url": "gitea@git.lumeweb.com:LumeWeb/node-library-preset.git"
@ -9,6 +19,7 @@
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"presetter": "^4.0.1",
"presetter-preset-hybrid": "^4.0.1",
"presetter-preset-strict": "^4.0.1",
"semantic-release": "^21.0.5"
},
@ -22,7 +33,8 @@
"dependencies": {
"presetter-types": "^4.0.1"
},
"peerDependencies": {
"presetter-preset-strict": "workspace:*"
}
"files": [
"lib/**",
"templates/**"
]
}

View File

@ -1,12 +1,8 @@
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import { resolve } from "node:path";
import type { PresetAsset } from "presetter-types";
const DIR = dirname(fileURLToPath(import.meta.url));
// paths to the template directory
const TEMPLATES = resolve(DIR, "..", "templates");
export const DEFAULT_VARIABLE = {
source: "src",
};
@ -16,16 +12,34 @@ export const DEFAULT_VARIABLE = {
* @returns list of preset templates
*/
export default async function (): Promise<PresetAsset> {
let DIR: string;
if (typeof __dirname === "undefined") {
DIR = (await import("./path.js")).default();
} else {
DIR = __dirname;
}
const TEMPLATES = resolve(DIR, "..", "templates");
return {
extends: ["presetter-preset-strict"],
template: {
".circleci/config.yml": resolve(TEMPLATES, "circleci.yml"),
".github/workflows/ci.yml": resolve(TEMPLATES, "ci.yml.raw"),
".releaserc.json": resolve(TEMPLATES, ".releaserc.json"),
},
noSymlinks: [".github/workflows/ci.yml"],
variable: DEFAULT_VARIABLE,
supplementaryConfig: {
prettier: {
singleQuote: false,
},
gitignore: [".releaserc.json"],
tsconfig: {
compilerOptions: {
lib: ["ES2021", "dom"],
},
},
},
};
}

7
src/path.ts Normal file
View File

@ -0,0 +1,7 @@
import { dirname } from "node:path";
import { fileURLToPath } from "node:url";
export default function () {
// @ts-ignore
return dirname(fileURLToPath(import.meta.url));
}

View File

@ -8,7 +8,7 @@
{ "revert": true, "release": "patch" },
{ "type": "feat", "release": "minor" },
{ "type": "fix", "release": "patch" },
{ "type": "perf", "release": "patch" }
{ "type": "perf", "release": "patch" },
{ "type": "refactor", "release": "patch" }
]
}

13
templates/ci.yml.raw Normal file
View File

@ -0,0 +1,13 @@
name: Build/Publish
on:
push:
branches:
- master
- develop
- develop-*
jobs:
main:
uses: lumeweb/github-node-deploy-workflow/.github/workflows/main.yml@master
secrets: inherit

View File

@ -1,45 +0,0 @@
version: 2.1
orbs:
node: circleci/node@5.1.0
ssh: credijusto/ssh@0.5.2
workflows:
release:
jobs:
- node/run:
name: build
npm-run: build
post-steps:
- persist_to_workspace:
root: .
paths:
- lib/
filters:
branches:
only:
- master
- develop
- /^develop-.*$/
- node/run:
name: release
npm-run: semantic-release
requires:
- build
filters:
branches:
only:
- master
- develop
- /^develop-.*$/
context:
- publish
setup:
- attach_workspace:
at: ./
- add_ssh_keys:
fingerprints:
- "47:cf:a1:17:d9:81:8e:c5:51:e5:53:c8:33:e4:33:b9"
- ssh/ssh-add-host:
host_url: GITEA_HOST