Skip to content

Commit ecc8185

Browse files
committed
Merge branch 'main' of github.com:sullyTheDev/ts-array-sort into main
2 parents 0fa760d + 6784e9c commit ecc8185

3 files changed

Lines changed: 48 additions & 2 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: NPM publish CD workflow
2+
3+
on:
4+
release:
5+
# This specifies that the build will be triggered when we publish a release
6+
types: [published]
7+
8+
jobs:
9+
build:
10+
11+
# Run on latest version of ubuntu
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
# "ref" specifies the branch to check out.
18+
# "github.event.release.target_commitish" is a global variable and specifies the branch the release targeted
19+
ref: ${{ github.event.release.target_commitish }}
20+
# install Node.js
21+
- name: Use Node.js 12
22+
uses: actions/setup-node@v1
23+
with:
24+
node-version: 12
25+
# Specifies the registry, this field is required!
26+
registry-url: https://registry.npmjs.org/
27+
# clean install of your projects' deps. We use "npm ci" to avoid package lock changes
28+
- run: npm ci
29+
# set up git since we will later push to the repo
30+
- run: git config --global user.name "GitHub CD bot"
31+
- run: git config --global user.email "github-cd-bot@example.com"
32+
# upgrade npm version in package.json to the tag used in the release.
33+
- run: npm version ${{ github.event.release.tag_name }}
34+
# build the project
35+
- run: npm run build
36+
# run tests just in case
37+
# - run: npm test
38+
- run: npm publish
39+
env:
40+
# Use a token to publish to NPM. See below for how to set it up
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
# push the version changes to GitHub
43+
- run: git push
44+
env:
45+
# The secret is passed automatically. Nothing to configure.
46+
github-token: ${{ secrets.GITHUB_TOKEN }}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ts-array-sort",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "A simple array sorter built on typescript",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

0 commit comments

Comments
 (0)