-
Notifications
You must be signed in to change notification settings - Fork 14
add: automated release flow for widgets/packages, and event dispatch for automated wallet integration trigger #131
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
Open
L03TJ3
wants to merge
2
commits into
main
Choose a base branch
from
widget-release-flow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 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,5 @@ | ||
| # Release automation and integration contracts require maintainer review. | ||
| /.github/workflows/ @GoodDollar/goodbuilders-maintainers | ||
| /scripts/release/ @GoodDollar/goodbuilders-maintainers | ||
| /schemas/ @GoodDollar/goodbuilders-maintainers | ||
| /packages/*/integration-manifest.json @GoodDollar/goodbuilders-maintainers |
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
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
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
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,59 @@ | ||
| name: Promote main to next | ||
|
|
||
| # main remains the development/deployment branch. A reviewed manual promotion is the only | ||
| # supported path to next, and only next is wired to npm publication. | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| source: | ||
| description: Source branch (intentionally restricted) | ||
| required: true | ||
| type: choice | ||
| options: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: goodwidget-next-promotion | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| promote: | ||
| permissions: | ||
| contents: write | ||
| # The release environment supplies the maintainer approval gate before next can move. | ||
| environment: release | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Require a maintainer and main as source | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| ACTOR: ${{ github.actor }} | ||
| SOURCE: ${{ inputs.source }} | ||
| REPOSITORY: ${{ github.repository }} | ||
| run: | | ||
| test "$SOURCE" = main | ||
| permission="$(gh api "repos/$REPOSITORY/collaborators/$ACTOR/permission" --jq .permission)" | ||
| test "$permission" = admin -o "$permission" = maintain | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: main | ||
| - name: Create or update next | ||
| env: | ||
| GIT_AUTHOR_NAME: goodwidget-release | ||
| GIT_AUTHOR_EMAIL: goodwidget-release@users.noreply.github.com | ||
| GIT_COMMITTER_NAME: goodwidget-release | ||
| GIT_COMMITTER_EMAIL: goodwidget-release@users.noreply.github.com | ||
| run: | | ||
| git fetch origin main next || git fetch origin main | ||
| if git show-ref --verify --quiet refs/remotes/origin/next; then | ||
| # A normal merge preserves next's release history and exits before push on conflicts. | ||
| git switch --create next --track origin/next | ||
| git merge --no-edit origin/main | ||
| else | ||
| # The first promotion creates the long-lived publication branch from main. | ||
| git switch --create next origin/main | ||
| fi | ||
| git push origin next |
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,57 @@ | ||
| name: Recover committed npm release | ||
|
|
||
| # Recovery never computes a new version. It republishes (or only verifies) the version | ||
| # already committed on next after an interrupted registry publication. | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| package: | ||
| description: Already-versioned production package to publish or verify | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - '@goodwidget/ui' | ||
| - '@goodwidget/core' | ||
| - '@goodwidget/embed' | ||
| - '@goodwidget/ai-credits-widget' | ||
| - '@goodwidget/citizen-claim-widget' | ||
| - '@goodwidget/goodreserve-widget' | ||
| - '@goodwidget/staking-migration-widget' | ||
| - '@goodwidget/streaming-widget' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: goodwidget-npm-release | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| recover: | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| environment: release | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: next | ||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | ||
| with: | ||
| node-version: 22.14.0 | ||
| registry-url: https://registry.npmjs.org | ||
| - name: Configure pinned toolchain | ||
| run: | | ||
| corepack enable | ||
| corepack prepare pnpm@9.15.0 --activate | ||
| - run: pnpm install --frozen-lockfile | ||
| - name: Publish the authoritative committed version | ||
| env: | ||
| RECOVERY_PACKAGE: ${{ inputs.package }} | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| NPM_CONFIG_PROVENANCE: 'true' | ||
| GOODWALLET_DISPATCH_PAT: ${{ secrets.GOODWALLET_DISPATCH_PAT }} | ||
| ENABLE_GOODWALLET_DISPATCH: ${{ vars.ENABLE_GOODWALLET_DISPATCH }} | ||
| run: pnpm release:recover |
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,56 @@ | ||
| name: Release production packages | ||
|
|
||
| # Publication is intentionally branch-gated: pushes to main may deploy demos, but cannot | ||
| # enter this workflow. A maintainer must first promote main to next. | ||
| on: | ||
| push: | ||
| branches: [next] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: goodwidget-npm-release | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| release: | ||
| # The release script pushes its authoritative version commit back to next. The marker | ||
| # prevents that bot-authored push from recursively starting another release. | ||
| if: ${{ !contains(github.event.head_commit.message, '[goodwidget release]') }} | ||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
| environment: release | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: next | ||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | ||
| with: | ||
| node-version: 22.14.0 | ||
| registry-url: https://registry.npmjs.org | ||
| - name: Configure pinned toolchain | ||
| run: | | ||
| corepack enable | ||
| corepack prepare pnpm@9.15.0 --activate | ||
| node --version | ||
| pnpm --version | ||
| - name: Install immutable workspace | ||
| run: pnpm install --frozen-lockfile | ||
| - name: Configure release identity | ||
| run: | | ||
| git config user.name goodwidget-release | ||
| git config user.email goodwidget-release@users.noreply.github.com | ||
| - name: Build, pack, publish, verify, and dispatch | ||
| env: | ||
| RELEASE_BASE_SHA: ${{ github.event.before }} | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| NPM_CONFIG_PROVENANCE: 'true' | ||
| GOODWALLET_DISPATCH_PAT: ${{ secrets.GOODWALLET_DISPATCH_PAT }} | ||
| # Wallet automation remains inert until both this explicit switch and its scoped | ||
| # repository-dispatch credential are configured in the protected environment. | ||
| ENABLE_GOODWALLET_DISPATCH: ${{ vars.ENABLE_GOODWALLET_DISPATCH }} | ||
| run: pnpm release:widgets | ||
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,35 @@ | ||
| name: Validate release contracts | ||
|
|
||
| # Keep graph detection, packaging, and the wallet-facing manifest contract reviewable | ||
| # before either promotion or release credentials can be reached. | ||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'package.json' | ||
| - 'pnpm-lock.yaml' | ||
| - 'pnpm-workspace.yaml' | ||
| - 'packages/**' | ||
| - 'schemas/**' | ||
| - 'scripts/release/**' | ||
| - '.github/workflows/**' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| validate: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | ||
| with: | ||
| node-version: 22.14.0 | ||
| - name: Configure pinned toolchain | ||
| run: | | ||
| corepack enable | ||
| corepack prepare pnpm@9.15.0 --activate | ||
| - run: pnpm install --frozen-lockfile | ||
| - run: pnpm test:release | ||
| - run: pnpm lint | ||
| - run: pnpm build | ||
| - run: pnpm validate:register-entries |
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,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2026 GoodDollar | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
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
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
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,15 @@ | ||
| { | ||
| "schemaVersion": "2.0.0", | ||
| "hostContractVersion": "1.0.0", | ||
| "widgetId": "goodwidget.ai-credits", | ||
| "packageName": "@goodwidget/ai-credits-widget", | ||
| "entries": { | ||
| "react": { | ||
| "export": "AiCreditsWidget" | ||
| }, | ||
| "webComponent": { | ||
| "registerPath": "./register", | ||
| "tagName": "ai-credits-widget" | ||
| } | ||
| } | ||
| } |
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.