Skip to content

Commit 8d4ca35

Browse files
authored
Shared configs/worflows/autorelease (#137)
* Rename workflow to 'Nutrition Facts autorelease' * use dispatches * @instructure.ai/[email protected] * @instructure.ai/[email protected] * @instructure.ai/[email protected]
1 parent 52473ee commit 8d4ca35

File tree

5 files changed

+23
-9
lines changed

5 files changed

+23
-9
lines changed

.github/workflows/nutritionfacts-auto-release.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: After aiinfo Release → Bump nutritionfacts
1+
name: Nutrition Facts autorelease
22

33
on:
4-
release:
5-
types: [published]
4+
repository_dispatch:
5+
types: [aiinfo_release]
66

77
permissions:
88
contents: write
@@ -16,8 +16,6 @@ jobs:
1616
name: Bump nutritionfacts on aiinfo release
1717
runs-on: ubuntu-latest
1818

19-
if: contains(github.event.release.name, '@instructure.ai/aiinfo') || contains(github.event.release.tag_name, '@instructure.ai/aiinfo')
20-
2119
steps:
2220
- name: Checkout
2321
uses: actions/checkout@v4
@@ -87,9 +85,10 @@ jobs:
8785
shell: bash
8886
run: |
8987
set -euo pipefail
88+
RELEASE_LABEL="${{ github.event.client_payload.tag || 'aiinfo release' }}"
9089
PR_URL=$(gh pr create \
9190
--title "(chore) nutritionfacts deps sync after aiinfo release" \
92-
--body "Automated bump after release: **${{ github.event.release.tag_name || github.event.release.name }}**" \
91+
--body "Automated bump after release: **${RELEASE_LABEL}**" \
9392
--base main \
9493
--head "${{ steps.mkbranch.outputs.branch }}")
9594
echo "Opened PR: $PR_URL"

.github/workflows/release-package.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,18 @@ jobs:
155155
gh release create "$TAG" ./packages/$PKG_NAME/dist/*.tgz --title "$TAG" --generate-notes
156156
fi
157157
done
158+
159+
- name: Trigger nutritionfacts auto-release
160+
if: steps.find_tags.outputs.tags != ''
161+
env:
162+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
163+
TAGS: ${{ steps.find_tags.outputs.tags }}
164+
run: |
165+
for TAG in $TAGS; do
166+
# Extract the package name from the tag (e.g., @instructure.ai/[email protected] => foo)
167+
NAME=$(echo "$TAG" | sed -E 's/@instructure.ai\/([^@]+)@.*/\1/')
168+
EVENT_TYPE="${NAME}_release"
169+
gh api repos/${{ github.repository }}/dispatches \
170+
-F event_type="$EVENT_TYPE" \
171+
-F client_payload="$(jq -nc --arg tag "$TAG" '{tag: $tag}')"
172+
done

apps/nutritionfacts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@
2828
"update-cache": "vite-node ./scripts/updateCache.mts"
2929
},
3030
"type": "module",
31-
"version": "1.4.0"
31+
"version": "1.4.2"
3232
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"vitest": "^3.2.4",
2323
"yaml": "^2.8.1"
2424
},
25-
"version": "1.4.0",
25+
"version": "1.4.2",
2626
"name": "@instructure.ai/shared-configs",
2727
"packageManager": "[email protected]",
2828
"private": true,

packages/aiinfo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@
5050
"sideEffects": false,
5151
"type": "module",
5252
"types": "./dist/index.d.ts",
53-
"version": "1.4.1"
53+
"version": "1.4.2"
5454
}

0 commit comments

Comments
 (0)