Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 6 additions & 1 deletion .github/workflows/cpp-lint-qvac-lib-infer-nmtcpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ jobs:
- name: Configure npm registries
shell: bash
run: |
echo "@qvac:registry=https://registry.npmjs.org/" >> .npmrc
ref_name="${{ inputs.ref || github.ref_name }}"
qvac_registry="https://npm.pkg.github.com/"
if [[ "$ref_name" == release-* ]]; then
qvac_registry="https://registry.npmjs.org/"
fi
echo "@qvac:registry=${qvac_registry}" >> .npmrc
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
echo "@tetherto:registry=https://npm.pkg.github.com/" >> .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.PAT_TOKEN }}" >> .npmrc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,23 @@ jobs:

- name: Configure scoped registry for @qvac and @tetherto packages
env:
GPR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPR_TOKEN: ${{ secrets.PAT_TOKEN }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail. We don't have a valid PAT_TOKEN. We use the GITHUB_TOKEN for GPR authentication

NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_PAT: ${{ secrets.PAT_TOKEN }}
run: |
echo "Configuring scoped registry for @tetherto and @qvac packages..."

# Configure addon registry
cd monorepo/${{ inputs.workdir || env.PKG_DIR }}
ref_name="${{ inputs.ref || github.ref_name }}"
qvac_registry="https://npm.pkg.github.com/"
if [[ "$ref_name" == release-* ]]; then
qvac_registry="https://registry.npmjs.org/"
fi
cat > .npmrc <<NPMRC
always-auth=true
registry=https://registry.npmjs.org/
@qvac:registry=https://registry.npmjs.org/
@qvac:registry=${qvac_registry}
@tetherto:registry=https://npm.pkg.github.com/
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
//npm.pkg.github.com/:_authToken=${GPR_TOKEN}
Expand All @@ -129,7 +134,7 @@ jobs:
cat > .npmrc <<NPMRC
always-auth=true
registry=https://registry.npmjs.org/
@qvac:registry=https://registry.npmjs.org/
@qvac:registry=${qvac_registry}
@tetherto:registry=https://npm.pkg.github.com/
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
//npm.pkg.github.com/:_authToken=${GPR_TOKEN}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,23 @@ jobs:
- name: Configure scoped registry for @tetherto and @qvac packages
working-directory: ${{ inputs.workdir || env.PKG_DIR }}
env:
GPR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPR_TOKEN: ${{ secrets.PAT_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_PAT: ${{ secrets.PAT_TOKEN }}
shell: bash
run: |
echo "Configuring scoped registry for @tetherto and @qvac packages..."
set -eu
echo "Writing .npmrc for dual registry install…"
ref_name="${{ inputs.ref || github.ref_name }}"
qvac_registry="https://npm.pkg.github.com/"
if [[ "$ref_name" == release-* ]]; then
qvac_registry="https://registry.npmjs.org/"
fi
cat > .npmrc <<NPMRC
always-auth=true
registry=https://registry.npmjs.org/
@qvac:registry=https://registry.npmjs.org/
@qvac:registry=${qvac_registry}
@tetherto:registry=https://npm.pkg.github.com/
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
//npm.pkg.github.com/:_authToken=${GPR_TOKEN}
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/on-merge-qvac-lib-infer-nmtcpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@ on:
push:
branches:
- main
- release-*
paths:
- "packages/qvac-lib-infer-nmtcpp/**"
workflow_dispatch:
inputs:
tag:
description: "Tag to publish with"
required: true
default: "dev"
type: choice
options:
- latest
- dev
required: false
default: ""
type: string

permissions:
contents: write
Expand All @@ -27,8 +25,7 @@ jobs:
uses: ./.github/workflows/prebuilds-qvac-lib-infer-nmtcpp.yml
secrets: inherit
with:
tag: ${{ inputs.tag || 'latest' }}
publish_target: "npm"
tag: ${{ inputs.tag }}

model-conversion-test:
needs: [prebuild]
Expand All @@ -40,5 +37,5 @@ jobs:
uses: ./.github/workflows/integration-test-qvac-lib-infer-nmtcpp.yml
secrets: inherit
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.repository }}
ref: ${{ github.ref }}
4 changes: 0 additions & 4 deletions .github/workflows/on-pr-close-qvac-lib-infer-nmtcpp.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Unpublish GPR Package Versions (Qvac-lib-infer-nmtcpp)

on:
pull_request:
types: [closed]
paths:
- "packages/qvac-lib-infer-nmtcpp/**"
workflow_dispatch:
inputs:
version:
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/on-pr-qvac-lib-infer-nmtcpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
uses: tetherto/qvac-devops/.github/actions/run-lint-and-unit-tests@monorepo_update
with:
npm-token: ${{ secrets.NPM_TOKEN }}
gpr-token: ${{ secrets.GITHUB_TOKEN }}
gpr-token: ${{ secrets.PAT_TOKEN }}
pat-token: ${{ secrets.PAT_TOKEN }}
workdir: ${{ env.PKG_DIR }}

Expand Down Expand Up @@ -147,11 +147,18 @@ jobs:

- name: Configure npm auth
run: |
base_ref="${{ github.event.pull_request.base.ref || github.ref_name }}"
qvac_registry="https://npm.pkg.github.com/"
if [[ "$base_ref" == release-* ]]; then
qvac_registry="https://registry.npmjs.org/"
fi
cat > .npmrc <<NPMRC
always-auth=true
registry=https://registry.npmjs.org/
@qvac:registry=https://registry.npmjs.org/
@qvac:registry=${qvac_registry}
@tetherto:registry=https://npm.pkg.github.com/
//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
//npm.pkg.github.com/:_authToken=${{ secrets.PAT_TOKEN }}
NPMRC

- name: Install dependencies
Expand Down
28 changes: 20 additions & 8 deletions .github/workflows/prebuilds-qvac-lib-infer-nmtcpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ jobs:
secret-token: ${{ secrets.NPM_TOKEN }}
tag: "latest"
workdir: ${{ env.PKG_DIR }}
name-suffix: "-mono"

check-version-change:
needs: [publish-npm]
Expand Down Expand Up @@ -826,11 +827,22 @@ jobs:
echo "version=" >> $GITHUB_OUTPUT
fi

# TODO: Migrate benchmark workflow
# run-automated-benchmarks:
# needs: [check-version-change]
# if: needs.check-version-change.outputs.version_changed == 'true'
# uses: ./.github/workflows/on-publish-benchmark-qvac-lib-infer-nmtcpp.yaml
# secrets: inherit
# with:
# version: ${{ needs.check-version-change.outputs.new_version }}
create-github-release:
needs: [check-version-change]
if: needs.check-version-change.outputs.version_changed == 'true' && startsWith(github.ref_name, 'release-')
permissions:
contents: write
uses: ./.github/workflows/create-github-release-qvac-lib-infer-nmtcpp.yml
secrets: inherit
with:
published_version: ${{ needs.check-version-change.outputs.new_version }}
prev_sha: ${{ github.event.before }}
workdir: ${{ env.PKG_DIR }}

run-automated-benchmarks:
needs: [check-version-change]
if: needs.check-version-change.outputs.version_changed == 'true'
uses: ./.github/workflows/on-publish-benchmark-qvac-lib-infer-nmtcpp.yml
secrets: inherit
with:
version: ${{ needs.check-version-change.outputs.new_version }}
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,15 @@ jobs:

- name: Configure scoped registry for @tetherto and @qvac packages
run: |
ref_name="${{ inputs.ref || github.ref_name }}"
qvac_registry="https://npm.pkg.github.com/"
if [[ "$ref_name" == release-* ]]; then
qvac_registry="https://registry.npmjs.org/"
fi
cat > .npmrc <<NPMRC
always-auth=true
registry=https://registry.npmjs.org/
@qvac:registry=https://registry.npmjs.org/
@qvac:registry=${qvac_registry}
@tetherto:registry=https://npm.pkg.github.com/
//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
//npm.pkg.github.com/:_authToken=${{ secrets.PAT_TOKEN }}
Expand Down