Skip to content

Commit 42b6b60

Browse files
committed
chore: add GitHub Actions workflows for publishing and verification
1 parent e65aff8 commit 42b6b60

7 files changed

Lines changed: 109 additions & 24 deletions

File tree

.github/workflows/publish.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Publish
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
SEMVER_TYPE:
7+
description: 'Semver type'
8+
required: true
9+
default: 'patch'
10+
type: choice
11+
options:
12+
- patch
13+
- minor
14+
- major
15+
16+
jobs:
17+
publish-npm:
18+
environment: publish
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
id-token: write
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Check if on main branch
26+
run: |
27+
if [[ $GITHUB_REF != 'refs/heads/main' ]]; then
28+
echo "This workflow must run on the 'main' branch."
29+
exit 1
30+
fi
31+
- uses: actions/setup-node@v4
32+
with:
33+
node-version: 'lts/*'
34+
cache: 'npm'
35+
registry-url: 'https://registry.npmjs.org'
36+
scope: '@workfront'
37+
- run: npm ci
38+
- name: Bump package version
39+
run: |
40+
git config --global user.name 'github-actions[bot]'
41+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
42+
echo "Bumping version as ${{ github.event.inputs.SEMVER_TYPE }}"
43+
npm version ${{ github.event.inputs.SEMVER_TYPE }}
44+
VERSION=$(node -p "require('./package.json').version")
45+
git push origin main --follow-tags
46+
- run: npm publish --provenance --access public
47+
env:
48+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/verify.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Verify
2+
3+
on:
4+
push:
5+
branches: [ $default-branch ]
6+
pull_request:
7+
branches: [ $default-branch ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: lts/*
18+
cache: 'npm'
19+
registry-url: 'https://registry.npmjs.org'
20+
scope: '@workfront'
21+
- run: npm ci
22+
- run: npm run build

.travis.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# workfront-api-constants
1+
# @workfront/api-constants
22

3-
[![NPM version][npm-version-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url] [![Apache v2 License][license-image]][license-url] [![Build Status][travis-image]][travis-url]
3+
[![NPM version][npm-version-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-url] [![Apache v2 License][license-image]][license-url]
44

55
Definitions for all constants which can be used to interact with Workfront API
66

@@ -45,9 +45,6 @@ See the top-level file `LICENSE` and
4545
[license-image]: http://img.shields.io/badge/license-APv2-blue.svg?style=flat
4646
[license-url]: LICENSE
4747

48-
[npm-url]: https://www.npmjs.org/package/workfront-api-constants
49-
[npm-version-image]: https://img.shields.io/npm/v/workfront-api-constants.svg?style=flat
50-
[npm-downloads-image]: https://img.shields.io/npm/dm/workfront-api-constants.svg?style=flat
51-
52-
[travis-url]: https://travis-ci.org/Workfront/workfront-api-constants
53-
[travis-image]: https://img.shields.io/travis/Workfront/workfront-api-constants.svg?style=flat
48+
[npm-url]: https://www.npmjs.org/package/@workfront/api-constants
49+
[npm-version-image]: https://img.shields.io/npm/v/@workfront/api-constants.svg?style=flat
50+
[npm-downloads-image]: https://img.shields.io/npm/dm/@workfront/api-constants.svg?style=flat

package-lock.json

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@
1111
],
1212
"dependencies": {},
1313
"devDependencies": {
14-
"npm-run-all": "4.1.5",
15-
"typescript": "3.8.3"
14+
"typescript": "5.8.2"
1615
},
1716
"scripts": {
18-
"prepublish": "npm run build",
17+
"prepublishOnly": "npm run build",
1918
"build:umd": "tsc --removeComments --module umd --outDir dist/umd/ src/*.ts",
2019
"build:es": "tsc --module es6 --target es5 --declaration --outDir dist/ src/*.ts",
21-
"build": "run-p build:**",
20+
"build": "npm run build:umd && npm run build:es",
2221
"test": "exit 0"
2322
},
2423
"repository": {

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"exclude": [
33
"node_modules"
44
],
5+
"strict": true,
56
"compileOnSave": false,
67
"buildOnSave": false,
78
"atom": {

0 commit comments

Comments
 (0)