Skip to content

Commit 98389f6

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

8 files changed

Lines changed: 12807 additions & 7002 deletions

File tree

.github/workflows/publish.yml

Lines changed: 58 additions & 0 deletions
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,46 @@
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:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: lts/*
20+
cache: 'npm'
21+
registry-url: 'https://registry.npmjs.org'
22+
scope: '@workfront'
23+
- run: npm ci --no-audit --no-fund
24+
- run: npm run build
25+
626
test-mocha:
727
runs-on: ubuntu-latest
828

929
strategy:
1030
matrix:
11-
node-version: [18.x, 20.x]
31+
node-version: [ 18.x, 20.x ]
1232

1333
steps:
1434
- uses: actions/checkout@v4
1535
name: Use Node.js ${{ matrix.node-version }}
1636
- uses: actions/setup-node@v4
1737
with:
1838
node-version: ${{ matrix.node-version }}
19-
- run: yarn install --frozen-lockfile
20-
- run: yarn run test:mocha
39+
cache: 'npm'
40+
registry-url: 'https://registry.npmjs.org'
41+
scope: '@workfront'
42+
- run: npm ci --no-audit --no-fund
43+
- run: npm run test:mocha
2144

2245
test-karma:
2346
runs-on: ubuntu-latest
@@ -28,19 +51,23 @@ jobs:
2851

2952
steps:
3053
- uses: actions/checkout@v4
31-
name: Use latest Node.js version
54+
name: Use Node LTS version
3255
- uses: saucelabs/sauce-connect-action@v2
3356
with:
3457
username: ${{ secrets.SAUCE_USERNAME }}
3558
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
3659
tunnelIdentifier: github-action-tunnel
3760
scVersion: 4.6.4
3861
- uses: actions/setup-node@v4
39-
- run: yarn install --frozen-lockfile
40-
- run: yarn run test:karma
62+
with:
63+
node-version: lts/*
64+
cache: 'npm'
65+
registry-url: 'https://registry.npmjs.org'
66+
scope: '@workfront'
67+
- run: npm ci --no-audit --no-fund
68+
- run: npm run test:karma
4169
- uses: codecov/codecov-action@v4
4270
with:
4371
directory: ./coverage/
4472
fail_ci_if_error: true
45-
path_to_write_report: ./coverage/codecov_report.txt
4673
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)