forked from kvandake/lexorank-ts
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up for CI build publication through Github Workflows to @dalet-oss …
…organisation co-ordinates
- Loading branch information
1 parent
1468280
commit ebc6cfb
Showing
6 changed files
with
134 additions
and
21 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,39 @@ | ||
name: 'CI Build' | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [ opened, reopened, edited, synchronize ] | ||
branches: | ||
- master | ||
|
||
concurrency: | ||
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
compile-and-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'yarn' | ||
cache-dependency-path: 'yarn.lock' | ||
scope: '@dalet-oss' | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Build | ||
run: yarn build | ||
|
||
- name: Run tests | ||
run: yarn test |
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,40 @@ | ||
name: 'CI Publish to Maven Central' | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- 'release/*' | ||
|
||
concurrency: | ||
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
compile-test-and-publish-to-npm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'yarn' | ||
cache-dependency-path: 'yarn.lock' | ||
scope: '@dalet-oss' | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Build | ||
run: yarn build | ||
|
||
- name: Run tests | ||
run: yarn test | ||
|
||
- name: Publish to public NPM registry | ||
run: ./publish.sh | ||
env: | ||
NPM_REGISTRY_ACCESS_TOKEN: ${{ secrets.NPM_REGISTRY_ACCESS_TOKEN }} |
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 @@ | ||
registry=https://registry.npmjs.org |
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 |
---|---|---|
@@ -1,11 +1,15 @@ | ||
{ | ||
"name": "lexorank", | ||
"_id": "[email protected]", | ||
"version": "1.0.5", | ||
"name": "@dalet-oss/lexorank", | ||
"version": "1.0.0-DEV", | ||
"description": "A reference implementation of a list ordering system like JIRA's Lexorank algorithm", | ||
"author": { | ||
"name": "kvandake" | ||
"name": "Oliver Lockwood" | ||
}, | ||
"contributors": [ | ||
"Oliver Lockwood (@oliverlockwood)", | ||
"Manan Shah (@mananrshah)", | ||
"@kvandake" | ||
], | ||
"license": "MIT", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
|
@@ -15,24 +19,17 @@ | |
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/kvandake/lexorank-ts.git" | ||
"url": "git+https://github.com/dalet-oss/lexorank-ts.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/kvandake/lexorank-ts/issues" | ||
"url": "https://github.com/dalet-oss/lexorank-ts/issues" | ||
}, | ||
"homepage": "https://github.com/kvandake/lexorank-ts", | ||
"homepage": "https://github.com/dalet-oss/lexorank-ts", | ||
"scripts": { | ||
"clean": "rimraf lib", | ||
"build": "yarn run clean && tsc", | ||
"test": "jest", | ||
"lint": "eslint -c .eslintrc.js --ext .ts ./src", | ||
"prepublishOnly": "yarn test && yarn run lint", | ||
"preversion": "yarn run lint", | ||
"version": "git add -A src", | ||
"postversion": "git push && git push --tags", | ||
"storybook": "start-storybook -p 6006", | ||
"build-storybook": "build-storybook", | ||
"chromatic": "npx chromatic --project-token=$CHROMATIC_PROJECT_TOKEN" | ||
"lint": "eslint -c .eslintrc.js --ext .ts ./src" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.18.13", | ||
|
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,36 @@ | ||
echo 'Determining version number for publication' | ||
echo 'Looking for an existing release tag against this commit' | ||
|
||
VERSION=$(git describe --tags --match release/* --exact-match 2>&1) | ||
if [ $? -ne 0 ] | ||
then | ||
LAST=$(git describe --tags --match release/* 2>&1) | ||
if [ $? -ne 0 ] | ||
then | ||
echo 'No release tags found at all; bail out' | ||
exit 1 | ||
fi | ||
|
||
echo "No matching tag found. Push a tag like release/1.0.1 against HEAD in order to release. Most recent tag is: ${LAST}" | ||
exit 0 | ||
fi | ||
|
||
VERSION=$(echo $VERSION | sed 's#release/##g') | ||
echo "Publishing version: ${VERSION}" | ||
|
||
status=$(curl -s --head -w %{http_code} -o /dev/null https://www.npmjs.com/package/@dalet-oss/lexorank/v/${VERSION}/) | ||
if [ $status -eq 200 ] | ||
then | ||
echo 'Version already available on the NPM Registry. This must be a rebuild; nothing to do here.' | ||
else | ||
echo 'Version not already available on the NPM Registry' | ||
|
||
echo 'Setting the version into package.json' | ||
yarn version --no-git-tag-version --new-version ${VERSION} | ||
|
||
echo 'Adding NPM registry access token for https://registry.npmjs.org into local .npmrc' | ||
echo "//registry.npmjs.org/:_authToken=${NPM_REGISTRY_ACCESS_TOKEN}" >> .npmrc | ||
|
||
echo 'Publishing to NPM Central' | ||
npm publish --access public | ||
fi |