This repository has been archived by the owner on Nov 10, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
1,791 additions
and
72 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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
/package-lock.json | ||
/tmp.ts | ||
/tmp.js | ||
/tmp.sh | ||
.idea/ | ||
node_modules/ | ||
dist/ | ||
|
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
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,89 @@ | ||
import {values} from 'lodash'; | ||
import {Options} from 'yargs'; | ||
import {Obj} from '../interfaces/OptionsObject'; | ||
|
||
export enum TravisEndpoint { | ||
ORG = 'org', | ||
PRO = 'pro' | ||
} | ||
|
||
export interface HasTravisRelease { | ||
ghEmail: string; | ||
|
||
gpgKeyId: string; | ||
|
||
gpgKeyPwd: string; | ||
|
||
gpgPrivkey: string; | ||
|
||
gpgPubkey: string; | ||
|
||
releaseGhToken: string; | ||
|
||
releaseNpmToken: string; | ||
|
||
skipTravisRelease: boolean; | ||
|
||
travisEndpoint: TravisEndpoint; | ||
|
||
travisTokenOrg: string; | ||
|
||
travisTokenPro: string; | ||
} | ||
|
||
export function addTravisRelease(opts: Obj<Options> = {}): Obj<Options> { | ||
const gpg = ' for the GPG key used for signing release commits.'; | ||
const assigned: Obj<Options> = { | ||
'gh-email': { | ||
describe: 'Your GitHub email', | ||
type: 'string' | ||
}, | ||
'gpg-key-id': { | ||
describe: `Key ID${gpg}`, | ||
type: 'string' | ||
}, | ||
'gpg-key-pwd': { | ||
describe: `Password${gpg}`, | ||
type: 'string' | ||
}, | ||
'gpg-privkey': { | ||
describe: `Private key contents${gpg}`, | ||
type: 'string' | ||
}, | ||
'gpg-pubkey': { | ||
describe: `Public key contents${gpg}`, | ||
type: 'string' | ||
}, | ||
'release-gh-token': { | ||
describe: 'GitHub token for making releases. This should differ from the gh-token parameter and be local to ' | ||
+ 'this repo.', | ||
type: 'string' | ||
}, | ||
'release-npm-token': { | ||
describe: 'NPM token for making releases. This should be unique to this repo.', | ||
type: 'string' | ||
}, | ||
'skip-travis-release': { | ||
default: false, | ||
describe: 'Skip setting up a Travis release', | ||
type: 'boolean' | ||
}, | ||
'travis-endpoint': { | ||
choices: values(TravisEndpoint), | ||
default: TravisEndpoint.PRO, | ||
describe: 'Travis endpoint to use', | ||
type: 'string' | ||
}, | ||
'travis-token-org': { | ||
describe: `Travis token if using the ${TravisEndpoint.ORG} endpoint`, | ||
type: 'string' | ||
}, | ||
'travis-token-pro': { | ||
describe: `Travis token if using the ${TravisEndpoint.PRO} endpoint`, | ||
type: 'string' | ||
} | ||
}; | ||
Object.assign(opts, assigned); | ||
|
||
return opts; | ||
} |
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,3 @@ | ||
export const enum Chmod { | ||
C_755 = 0o755 | ||
} |
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,13 @@ | ||
import {cloneDeep} from 'lodash'; | ||
import {PackageJson} from '../interfaces/PackageJson'; | ||
|
||
// dev (ts-node) and prod (js) will have a different path | ||
|
||
/** @internal */ | ||
export const PKG_JSON: PackageJson = cloneDeep((() => { | ||
try { | ||
return require('../package.json'); | ||
} catch { | ||
return require('../../package.json'); | ||
} | ||
})()); |
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,5 @@ | ||
export const TRAVIS_NODE_VERSIONS: ReadonlyArray<string> = Object.freeze([ | ||
'stable', | ||
'lts/carbon', | ||
'lts/boron' | ||
]); |
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,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
PLAINTEXT_GPG=/tmp/alobuild-$(cat /proc/sys/kernel/random/uuid) | ||
|
||
echo $BUILD_GPG_PUB_KEY | base64 -d > $PLAINTEXT_GPG | ||
echo >> $PLAINTEXT_GPG | ||
echo $BUILD_GPG_PRIV_KEY | base64 -d >> $PLAINTEXT_GPG | ||
chmod 600 $PLAINTEXT_GPG | ||
gpg --batch --yes --import $PLAINTEXT_GPG | ||
rm -f $PLAINTEXT_GPG | ||
|
||
PWD_GPG=/tmp/alobuild-$(cat /proc/sys/kernel/random/uuid) | ||
|
||
echo '/usr/bin/gpg2 --passphrase ${BUILD_GPG_KEY_PWD} --batch --no-tty "$@"' > $PWD_GPG | ||
chmod 700 $PWD_GPG | ||
|
||
git config gpg.program $PWD_GPG | ||
git config commit.gpgsign true | ||
git config --global user.signingkey $BUILD_GPG_KEY_ID |
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,15 @@ | ||
global: | ||
dist-dirs: &distDirs dist | ||
|
||
clean-pkg-json: | ||
sort-scripts: true | ||
|
||
copy-files: | ||
from: | ||
- package.json | ||
- index.d.ts | ||
- LICENSE | ||
- CHANGELOG.md | ||
- README.md | ||
- src/fixtures | ||
to: *distDirs |
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,35 @@ | ||
branch: master | ||
tagFormat: '${version}' | ||
|
||
verifyConditions: | ||
- path: &npm '@semantic-release/npm' | ||
pkgRoot: '.' | ||
- &gh '@semantic-release/github' | ||
|
||
prepare: | ||
- '@semantic-release/changelog' | ||
- '@alorel-personal/semantic-release' | ||
- *npm | ||
- path: &exec '@semantic-release/exec' | ||
cmd: yarn run doctoc | ||
- path: *exec | ||
cmd: alo copy-files | ||
- path: *exec | ||
cmd: alo clean-dist | ||
- path: *exec | ||
cmd: alo clean-pkg-json | ||
- path: '@semantic-release/git' | ||
message: 'chore(release): ${nextRelease.version}' | ||
assets: | ||
- CHANGELOG.md | ||
- README.md | ||
- package.json | ||
- yarn.lock | ||
|
||
publish: | ||
- path: *npm | ||
pkgRoot: './dist' | ||
- *gh | ||
|
||
generateNotes: | ||
config: '@alorel-personal/conventional-changelog-alorel' |
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
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.