Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 1 addition & 141 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
if: github.repository_owner == 'rockcarver'
if: github.repository_owner == 'trivir'
steps:
- name: Checkout repository
uses: actions/checkout@v6
Expand Down Expand Up @@ -180,143 +180,3 @@ jobs:
- name: Security Audit
run: |
npm audit --omit=dev --audit-level high

npm-release:
if: github.ref == 'refs/heads/main'
needs: [build, test]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v7
with:
name: build

- name: Unzip build artifact
run: unzip build.zip

- uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies
run: npm ci

- name: Pre-Release
if: ${{ fromJSON(needs.build.outputs.preRelease) }}
uses: JS-DevTools/npm-publish@v4
with:
access: public
tag: 'next'
token: ${{ secrets.NPM_ACCESS_TOKEN }}

- name: Release
if: ${{ ! fromJSON(needs.build.outputs.preRelease) }}
uses: JS-DevTools/npm-publish@v4
with:
access: public
token: ${{ secrets.NPM_ACCESS_TOKEN }}

- name: Add next tag
if: ${{ ! fromJSON(needs.build.outputs.preRelease) }}
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_ACCESS_TOKEN }}" >> ~/.npmrc
npm whoami
npm dist-tag add @rockcarver/frodo-lib@${{ needs.build.outputs.newVersion }} next

release:
if: github.ref == 'refs/heads/main'
needs: [build, npm-release]
name: 'Release'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v6

- uses: actions/download-artifact@v7
with:
name: build

# need -o to overwrite package.json
- name: Unzip build artifact
run: unzip -o build.zip

- name: 'Github SHA'
id: github-sha
run: echo ${{ github.sha }} > Release.txt

- name: Update Changelog
uses: thomaseizinger/keep-a-changelog-new-release@v3
with:
tag: ${{ needs.build.outputs.newTag }}

- name: 'Output Changelog'
run: cat CHANGELOG.md

- name: 'Release Header'
id: release-header
run: echo "header=$(echo `grep '## \\[${{ needs.build.outputs.newVersion }}] -' CHANGELOG.md | sed 's/## //' | sed 's/\\[//' | sed 's/]//'`)" >> "$GITHUB_OUTPUT"

- name: 'Extract Release Notes'
id: extract-release-notes
uses: 'dahlia/submark@main'
with:
input-file: 'CHANGELOG.md'
heading-level: 2
heading-title-text: '${{ steps.release-header.outputs.header }}'
ignore-case: true
omit-heading: true

- name: Commit updated changelog, version, and docs
id: commit-changelog
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add CHANGELOG.md package.json package-lock.json docs
git commit --message "Updated changelog, version, and docs for release ${{ needs.build.outputs.newTag }}"
git push

- name: Release
uses: softprops/action-gh-release@v2
with:
name: Frodo Library ${{ needs.build.outputs.newVersion }}
tag_name: ${{ needs.build.outputs.newTag }}
body: ${{ steps.extract-release-notes.outputs.output-text }}
prerelease: ${{ needs.build.outputs.preRelease }}
generate_release_notes: ${{ contains(needs.build.outputs.newTag, '-') }}
files: |
CHANGELOG.md
LICENSE
Release.txt
token: ${{ secrets.GITHUB_TOKEN }}

doc:
if: github.ref == 'refs/heads/main'
needs: [build, release]
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- uses: actions/download-artifact@v7
with:
name: build
# need -o to overwrite package.json
- name: Unzip build artifact
run: unzip -o build.zip
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
# Upload docs directory
path: './docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"scripts": {
"test": "npm run test:only",
"test:only": "NODE_OPTIONS=--experimental-vm-modules npx jest --silent",
"test:only": "NODE_OPTIONS=--experimental-vm-modules npx jest --silent=false",
"test:debug": "NODE_OPTIONS=--experimental-vm-modules npx jest --silent=false",
"test:record": "NODE_OPTIONS=--experimental-vm-modules FRODO_POLLY_MODE=record npx jest --silent=false --runInBand --updateSnapshot --testPathPattern",
"test:record_noauth": "NODE_OPTIONS=--experimental-vm-modules FRODO_POLLY_MODE=record_noauth npx jest --silent=false --updateSnapshot --testPathIgnorePatterns cjs --testPathPattern",
Expand Down
6 changes: 4 additions & 2 deletions src/ops/AuthenticateOps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { getServerInfo, getServerVersionInfo } from '../api/ServerInfoApi';
import Constants from '../shared/Constants';
import { State } from '../shared/State';
import { encodeBase64Url } from '../utils/Base64Utils';
import { debugMessage, verboseMessage } from '../utils/Console';
import { debugMessage, printError, verboseMessage } from '../utils/Console';
import { isValidUrl, parseUrl } from '../utils/ExportImportUtils';
import {
CallbackHandler,
Expand Down Expand Up @@ -1315,6 +1315,8 @@ export async function getTokens({
return tokens;
}
} catch (error) {
throw new FrodoError(`Error getting tokens`, error);
printError(error);
throw error;
//throw new FrodoError(`Error getting tokens`, error);
}
}