-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 2024-01-31-scope-prefix
- Loading branch information
Showing
23 changed files
with
2,732 additions
and
1,076 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Build and Sign Binary Artifacts | ||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "lib/**" | ||
- "index.js" | ||
- "build.sh" | ||
- "nuwcdivnpt-bot.gpg.asc" | ||
- ".github/workflows/build-binary-artifacts.yml" | ||
jobs: | ||
build-binary-artifacts-and-sign: | ||
name: Build binary artifacts, sign, export | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: main | ||
fetch-depth: 0 | ||
|
||
- name: run build script | ||
id: run_build_script | ||
run: ./build.sh | ||
|
||
- name: Import GPG Key | ||
id: import_gpg | ||
run: | | ||
if ! echo "${{ secrets.WATCHER_PRIVATE_KEY }}" | gpg --import; then | ||
echo "::warning ::Private key GPG Import failed" | ||
exit 1 | ||
fi | ||
- name: Get version from package.json | ||
id: package_version | ||
run: echo "PACKAGE_VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV | ||
|
||
- name: Sign Artifacts | ||
id: sign_artifacts | ||
run: | | ||
if ! gpg --default-key [email protected] --armor --detach-sig ./dist/stigman-watcher-linux-${{ env.PACKAGE_VERSION }}.tar.gz; then | ||
echo "::warning ::Linux Signing failed" | ||
exit 1 | ||
fi | ||
if ! gpg --default-key [email protected] --armor --detach-sig ./dist/stigman-watcher-win-${{ env.PACKAGE_VERSION }}.zip; then | ||
echo "::warning ::Windows Signing failed" | ||
exit 1 | ||
fi | ||
- name: Verify Signatures | ||
id: verify_signatures | ||
working-directory: ./dist | ||
run: | | ||
if ! gpg --verify stigman-watcher-linux-${{ env.PACKAGE_VERSION }}.tar.gz.asc stigman-watcher-linux-${{ env.PACKAGE_VERSION }}.tar.gz; then | ||
echo "::warning ::Signature verification for Linux failed" | ||
exit 1 | ||
fi | ||
if ! gpg --verify stigman-watcher-win-${{ env.PACKAGE_VERSION }}.zip.asc stigman-watcher-win-${{ env.PACKAGE_VERSION }}.zip; then | ||
echo "::warning ::Signature verification for Windows failed" | ||
exit 1 | ||
fi | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: binary-artifacts | ||
path: | | ||
./dist/ | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Publish Package to npmjs | ||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# Setup .npmrc file to publish to npm | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
# Defaults to the user or organization that owns the workflow file | ||
scope: '@nuwcdivnpt' | ||
- run: npm ci | ||
- run: npm publish --provenance --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Run Unit Tests and Upload Coverage Artifact | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "lib/**" | ||
- "index.js" | ||
- "test/**" | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- "lib/**" | ||
- "index.js" | ||
- "test/**" | ||
|
||
jobs: | ||
build_test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Install app dependencies | ||
run: npm ci | ||
- name: Create .env file | ||
run: echo -e "WATCHER_COLLECTION=1\nWATCHER_API_BASE=url\nWATCHER_AUTHORITY=auth\nWATCHER_CLIENT_ID=clientId\nWATCHER_CLIENT_SECRET=secret" > .env | ||
- name: Run tests | ||
run: npm test | ||
- name: Upload coverage to github | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ always() }} | ||
with: | ||
name: coverage | ||
path: coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ watched/ | |
.vscode/ | ||
.env | ||
*.log | ||
log.json | ||
log.json | ||
bundle.js | ||
coverage/ |
Oops, something went wrong.