-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/dynamic functional context #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c03dfdf
chore: initialize branch and bump versions for dynamic functional con…
magmacomputing 712cf7e
chore: configure npm provenance repository directories, update README…
magmacomputing ff9ec2f
pre-evaluate()
magmacomputing ddf4975
PR initial review
magmacomputing d8f858a
PR 1st review
magmacomputing 82a196f
PR 2nd review
magmacomputing f436f0b
PR v4.0.0 initial review
magmacomputing 7a1c04b
devDependency
magmacomputing f93ec8f
v3 || v4
magmacomputing 44bfe8b
package-lock
magmacomputing 499d11a
tz assertion
magmacomputing 5aa0a1b
PR 1st review
magmacomputing fa08d52
PR 2nd review, .set()
magmacomputing e2a8fb7
standard tests
magmacomputing 27ee260
PR 3rd review
magmacomputing fcf8634
PR @deprecated
magmacomputing 76f3c49
harden multi-year term resolution
magmacomputing 6cbe8f4
fix vitest.configs for tempo-fns
magmacomputing File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,140 @@ | ||
| name: Publish Package with Provenance | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| package: | ||
| description: 'Package to publish' | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - '@magmacomputing/tempo' | ||
| - '@magmacomputing/tempo-pro' | ||
| - '@magmacomputing/tempo-fns' | ||
| - '@magmacomputing/tempo-plugin-ai' | ||
| - '@magmacomputing/tempo-plugin-astro' | ||
| - '@magmacomputing/tempo-plugin-batch' | ||
| - '@magmacomputing/tempo-plugin-finance' | ||
| - '@magmacomputing/tempo-plugin-snap' | ||
| - '@magmacomputing/tempo-plugin-sync' | ||
| - '@magmacomputing/tempo-plugin-ticker' | ||
| - 'all' | ||
| dry_run: | ||
| description: 'Dry run (simulate without uploading to registry)' | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write # Mandatory for npm Sigstore/OIDC cryptographic provenance | ||
|
|
||
| jobs: | ||
| validate-and-publish: | ||
| name: Publish with Provenance | ||
| if: github.ref == 'refs/heads/main' | ||
| environment: | ||
| name: npm | ||
| url: https://www.npmjs.com/org/magmacomputing | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| env: | ||
| TZ: America/New_York | ||
| LANG: en_US.UTF-8 | ||
| LC_ALL: en_US.UTF-8 | ||
| TEMPO_LICENSE_KEY: ${{ secrets.TEMPO_LICENSE_KEY || '' }} | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup Node.js 22 | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
|
magmacomputing marked this conversation as resolved.
|
||
| registry-url: 'https://registry.npmjs.org' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Setup Tempo License Key | ||
| run: | | ||
| if [ -n "$TEMPO_LICENSE_KEY" ]; then | ||
| LICENSE_FILE="${{ runner.temp }}/tempo.key" | ||
| echo "$TEMPO_LICENSE_KEY" > "$LICENSE_FILE" | ||
| echo "TEMPO_LICENSE_PATH=$LICENSE_FILE" >> $GITHUB_ENV | ||
| fi | ||
|
|
||
| - name: Build Monorepo Workspaces | ||
| run: | | ||
| npm run build:library | ||
| npm run build:tempo | ||
| npm run build --workspace=@magmacomputing/tempo-pro --workspace=@magmacomputing/tempo-fns --workspace=@magmacomputing/tempo-plugin-ai --workspace=@magmacomputing/tempo-plugin-astro --workspace=@magmacomputing/tempo-plugin-batch --workspace=@magmacomputing/tempo-plugin-finance --workspace=@magmacomputing/tempo-plugin-snap --workspace=@magmacomputing/tempo-plugin-sync --workspace=@magmacomputing/tempo-plugin-ticker --if-present | ||
|
|
||
| - name: Run Tests | ||
| run: npm run test | ||
|
|
||
| - name: Publish Selected Package | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| SELECTED_PKG: ${{ inputs.package }} | ||
| DRY_RUN: ${{ inputs.dry_run }} | ||
| run: | | ||
| PROVENANCE_FLAG="--provenance --access public" | ||
| if [ "$DRY_RUN" = "true" ]; then | ||
| PROVENANCE_FLAG="$PROVENANCE_FLAG --dry-run" | ||
| echo "🔍 DRY RUN MODE ACTIVATED — Simulating publication..." | ||
| fi | ||
|
|
||
| WORKSPACES=( | ||
| "@magmacomputing/tempo" | ||
| "@magmacomputing/tempo-pro" | ||
| "@magmacomputing/tempo-fns" | ||
| "@magmacomputing/tempo-plugin-ai" | ||
| "@magmacomputing/tempo-plugin-astro" | ||
| "@magmacomputing/tempo-plugin-batch" | ||
| "@magmacomputing/tempo-plugin-finance" | ||
| "@magmacomputing/tempo-plugin-snap" | ||
| "@magmacomputing/tempo-plugin-sync" | ||
| "@magmacomputing/tempo-plugin-ticker" | ||
| ) | ||
|
|
||
| publish_workspace() { | ||
| local pkg="$1" | ||
| local ver | ||
| ver=$(npm pkg get version --workspace="$pkg" --json | node -p "const d=JSON.parse(require('fs').readFileSync(0, 'utf8')); typeof d === 'string' ? d : (d['$pkg']?.version ?? d['$pkg'] ?? d.version ?? '')") | ||
| if [ -z "$ver" ] || [ "$ver" = "null" ]; then | ||
| echo "❌ Failed to resolve version for $pkg" | ||
| exit 1 | ||
| fi | ||
| echo "Checking $pkg@$ver on npm..." | ||
|
|
||
| if [ "$DRY_RUN" != "true" ] && npm view "$pkg@$ver" version >/dev/null 2>&1; then | ||
| echo "⏩ $pkg@$ver is already published on npm. Skipping to support partial release recovery." | ||
| return 0 | ||
| fi | ||
|
|
||
| echo "🚀 Publishing $pkg@$ver..." | ||
| npm publish --workspace="$pkg" $PROVENANCE_FLAG | ||
| } | ||
|
|
||
| if [ "$SELECTED_PKG" = "all" ]; then | ||
| echo "🔎 Preflighting all ${#WORKSPACES[@]} package versions..." | ||
| for pkg in "${WORKSPACES[@]}"; do | ||
| ver=$(npm pkg get version --workspace="$pkg" --json | node -p "const d=JSON.parse(require('fs').readFileSync(0, 'utf8')); typeof d === 'string' ? d : (d['$pkg']?.version ?? d['$pkg'] ?? d.version ?? '')") | ||
| echo " - $pkg: $ver" | ||
| if [ -z "$ver" ] || [ "$ver" = "null" ]; then | ||
| echo "❌ Failed to resolve version for $pkg" | ||
| exit 1 | ||
| fi | ||
|
magmacomputing marked this conversation as resolved.
|
||
| done | ||
|
|
||
| echo "🚀 Publishing all workspaces..." | ||
| for pkg in "${WORKSPACES[@]}"; do | ||
| publish_workspace "$pkg" | ||
| done | ||
| else | ||
| publish_workspace "$SELECTED_PKG" | ||
| fi | ||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.