Skip to content

Commit a057641

Browse files
committed
feat!: move package to workfront scope
BREAKING CHANGE: workfront-api is deprecated. use "@workfront/api" instead.
1 parent c5ada5c commit a057641

19 files changed

+13029
-200041
lines changed

.github/workflows/publish.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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: Public NPM registry
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write
22+
id-token: write
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
ssh-key: ${{ secrets.DEPLOY_KEY }}
27+
- name: Check if on main branch
28+
run: |
29+
if [[ $GITHUB_REF != 'refs/heads/main' ]]; then
30+
echo "This workflow must run on the 'main' branch."
31+
exit 1
32+
fi
33+
- uses: actions/setup-node@v4
34+
with:
35+
node-version: 'lts/*'
36+
cache: 'npm'
37+
registry-url: 'https://registry.npmjs.org'
38+
scope: '@workfront'
39+
- run: npm ci --no-fund --no-audit
40+
- name: Bump package version
41+
run: |
42+
git config --global user.name 'github-actions[bot]'
43+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
44+
echo "Bumping version as ${{ github.event.inputs.SEMVER_TYPE }}"
45+
npm version --no-commit-hooks ${{ github.event.inputs.SEMVER_TYPE }}
46+
git push origin main --follow-tags
47+
- name: Publish to NPM
48+
run: npm publish --provenance --access public
49+
env:
50+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
- name: Draft release
53+
run: |
54+
VERSION=$(node -p "require('./package.json').version")
55+
gh release create v$VERSION --generate-notes --draft --verify-tag --fail-on-no-commits
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
VERSION: ${{ inputs.next_version }}
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
1-
name: Checks
1+
name: Verify
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
411

512
jobs:
613
test-mocha:
714
runs-on: ubuntu-latest
815

916
strategy:
1017
matrix:
11-
node-version: [18.x, 20.x]
18+
node-version: [ 20.x, 22.x ]
1219

1320
steps:
1421
- uses: actions/checkout@v4
1522
name: Use Node.js ${{ matrix.node-version }}
1623
- uses: actions/setup-node@v4
1724
with:
1825
node-version: ${{ matrix.node-version }}
19-
- run: yarn install --frozen-lockfile
20-
- run: yarn run test:mocha
26+
cache: 'npm'
27+
registry-url: 'https://registry.npmjs.org'
28+
scope: '@workfront'
29+
- run: npm ci --no-audit --no-fund
30+
- run: npm run build
31+
- run: npm run test:mocha
2132

2233
test-karma:
2334
runs-on: ubuntu-latest
@@ -28,19 +39,24 @@ jobs:
2839

2940
steps:
3041
- uses: actions/checkout@v4
31-
name: Use latest Node.js version
42+
name: Use Node LTS version
3243
- uses: saucelabs/sauce-connect-action@v2
3344
with:
3445
username: ${{ secrets.SAUCE_USERNAME }}
3546
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
3647
tunnelIdentifier: github-action-tunnel
3748
scVersion: 4.6.4
3849
- uses: actions/setup-node@v4
39-
- run: yarn install --frozen-lockfile
40-
- run: yarn run test:karma
50+
with:
51+
node-version: lts/*
52+
cache: 'npm'
53+
registry-url: 'https://registry.npmjs.org'
54+
scope: '@workfront'
55+
- run: npm ci --no-audit --no-fund
56+
- run: npm run build
57+
- run: npm run test:karma
4158
- uses: codecov/codecov-action@v4
4259
with:
4360
directory: ./coverage/
4461
fail_ci_if_error: true
45-
path_to_write_report: ./coverage/codecov_report.txt
4662
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)