Skip to content

Commit 1fbcc4d

Browse files
authored
Merge branch 'feat/changesets-migration' into feat/turbo-migration
2 parents df87956 + f20902e commit 1fbcc4d

File tree

30 files changed

+784
-240
lines changed

30 files changed

+784
-240
lines changed

.changeset/config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"@changesets/changelog-github",
55
{ "repo": "aws-amplify/amplify-js" }
66
],
7+
"snapshot": {
8+
"useCalculatedVersion": true
9+
},
710
"commit": false,
811
"fixed": [],
912
"linked": [],

.github/workflows/release-hotfix.yml

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,37 @@ on:
1111
- hotfix
1212

1313
jobs:
14-
# Job 1: Run release verification tests when Version Packages PR is merged
14+
# Job 1: Check if there are unconsumed changesets
15+
setup:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
has-changesets: ${{ steps.has-changesets.outputs.has-changesets }}
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
22+
with:
23+
fetch-depth: 0
24+
- name: Check if repo has unconsumed changesets
25+
id: has-changesets
26+
uses: ./.github/actions/has-changesets
27+
# Note: if there are no changesets, that means either
28+
# (1) "Version Packages" PR was just merged, or
29+
# (2) no commits with changesets have been merged after packages were last published.
30+
#
31+
# In either case, we'll attempt to publish the packages. In case of (1), publish will succeed. In
32+
# case of (2), `@changesets/action` will know that packages have already been published and will
33+
# skip publish.
34+
35+
# Job 2: Run release verification tests when Version Packages PR is merged
1536
# This ensures all tests pass before publishing
1637
release-verification:
17-
# Only run when a Version Packages PR is merged (detected by commit message)
18-
if: github.event_name == 'push' && contains(github.event.head_commit.message, 'Version packages')
38+
# Only run when there are no changesets (meaning Version Packages PR was merged)
39+
needs: setup
40+
if: needs.setup.outputs.has-changesets != 'true'
1941
secrets: inherit
2042
uses: ./.github/workflows/callable-release-verification.yml
2143

22-
# Job 2: Publish packages after all tests pass
44+
# Job 3: Publish packages after all tests pass
2345
publish:
2446
runs-on: ubuntu-latest
2547
needs: release-verification
@@ -34,14 +56,16 @@ jobs:
3456
- name: Setup node and build the repository
3557
uses: ./amplify-js/.github/actions/node-and-build
3658

37-
- name: Publish to npm
38-
working-directory: ./amplify-js
39-
run: yarn changeset publish
59+
- name: Publish to @latest
60+
uses: changesets/action@aba318e9165b45b7948c60273e0b72fce0a64eb9 # v1.4.7
61+
with:
62+
cwd: ./amplify-js
63+
publish: yarn publish:latest
4064
env:
4165
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4266
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4367

44-
# Job 3: Create PR to merge hotfix back into main
68+
# Job 4: Create PR to merge hotfix back into main
4569
create-pr-to-main:
4670
needs: publish
4771
runs-on: ubuntu-latest

.github/workflows/release-latest.yml

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,41 @@ on:
1111
- main
1212

1313
jobs:
14-
# Job 1: Run release verification tests when Version Packages PR is merged
14+
# Job 1: Check if there are unconsumed changesets
15+
setup:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
has-changesets: ${{ steps.has-changesets.outputs.has-changesets }}
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
22+
with:
23+
fetch-depth: 0
24+
- name: Check if repo has unconsumed changesets
25+
id: has-changesets
26+
uses: ./.github/actions/has-changesets
27+
# Note: if there are no changesets, that means either
28+
# (1) "Version Packages" PR was just merged, or
29+
# (2) no commits with changesets have been merged after packages were last published.
30+
#
31+
# In either case, we'll attempt to publish the packages. In case of (1), publish will succeed. In
32+
# case of (2), `@changesets/action` will know that packages have already been published and will
33+
# skip publish.
34+
35+
# Job 2: Run release verification tests when Version Packages PR is merged
1536
# This ensures all tests pass before publishing
1637
release-verification:
17-
# Only run when a Version Packages PR is merged (detected by commit message)
18-
if: github.event_name == 'push' && contains(github.event.head_commit.message, 'Version packages')
38+
needs: setup
39+
if: needs.setup.outputs.has-changesets != 'true'
1940
secrets: inherit
2041
uses: ./.github/workflows/callable-release-verification.yml
2142

22-
# Job 2: Publish packages after all tests pass
43+
# Job 3: Publish packages after all tests pass
2344
publish:
2445
runs-on: ubuntu-latest
2546
needs: release-verification
47+
outputs:
48+
published: ${{ steps.changesets.outputs.published }}
2649
steps:
2750
- name: Checkout repository
2851
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -34,15 +57,19 @@ jobs:
3457
- name: Setup node and build the repository
3558
uses: ./amplify-js/.github/actions/node-and-build
3659

37-
- name: Publish to npm
38-
working-directory: ./amplify-js
39-
run: yarn changeset publish
60+
- name: Publish to @latest
61+
id: changesets
62+
uses: changesets/action@aba318e9165b45b7948c60273e0b72fce0a64eb9 # v1.4.7
63+
with:
64+
cwd: ./amplify-js
65+
publish: yarn publish:latest
4066
env:
4167
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4268
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4369

44-
# Job 3: Update local API documentation after successful publish
70+
# Job 4: Update local API documentation after successful publish
4571
update-local-docs:
72+
if: needs.publish.outputs.published == 'true'
4673
needs: publish
4774
runs-on: ubuntu-latest
4875
steps:
@@ -75,7 +102,7 @@ jobs:
75102
git commit -m "chore(release): Update API docs [skip release]" || echo "No changes to commit"
76103
git push origin main
77104
78-
# Job 4: Update external documentation repository
105+
# Job 5: Update external documentation repository
79106
update-external-docs:
80107
needs: update-local-docs
81108
secrets: inherit

.github/workflows/release-preid.yml

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
name: Release Preid
22

3+
# Concurrency control to prevent multiple preid releases running simultaneously
4+
# Cancels in-progress releases when new commits are pushed
5+
concurrency:
6+
group: push-release-${{ github.ref }}
7+
cancel-in-progress: true
8+
39
# Permissions required for publishing packages
410
permissions:
5-
contents: read
11+
contents: write
612

713
on:
814
push:
@@ -59,31 +65,13 @@ jobs:
5965
- name: Setup node and build the repository
6066
uses: ./amplify-js/.github/actions/node-and-build
6167

62-
- name: Add changeset preset for all packages
63-
working-directory: ./amplify-js
64-
run: |
65-
# Copy the preset changeset to ensure all packages get versioned
66-
cp .github/changeset-presets/bump-all-packages.md .changeset/
67-
echo "✅ Added changeset preset for preid release"
68-
69-
- name: Create snapshot versions
70-
working-directory: ./amplify-js
71-
env:
72-
PREID_PREFIX: ${{ needs.parse-preid.outputs.preid }}
73-
SHA: ${{ github.sha }}
74-
run: |
75-
export PREID_HASH_SUFFIX=$(echo $SHA | cut -c -7)
76-
yarn publish:preid
77-
echo "✅ Snapshot versions created with ${PREID_PREFIX}.${PREID_HASH_SUFFIX} identifier"
78-
79-
- name: Publish to npm
80-
working-directory: ./amplify-js
68+
- name: Publish to @preid
69+
uses: changesets/action@aba318e9165b45b7948c60273e0b72fce0a64eb9 # v1.4.7
70+
with:
71+
cwd: ./amplify-js
72+
publish: yarn publish:preid
73+
createGithubReleases: false
8174
env:
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8276
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
83-
PREID: ${{ needs.parse-preid.outputs.preid }}
84-
run: |
85-
# Configure npm authentication
86-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
87-
88-
# Publish with preid dist-tag
89-
yarn changeset publish --tag ${PREID} --no-git-tag
77+
PREID: ${{ needs.parse-preid.outputs.preid }}

.github/workflows/release-unstable.yml

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ concurrency:
66
group: push-release-${{ github.ref }}
77
cancel-in-progress: true
88

9+
# Permissions required for publishing packages
10+
permissions:
11+
contents: write
12+
913
on:
1014
push:
1115
branches:
@@ -32,29 +36,12 @@ jobs:
3236
- name: Setup node and build the repository
3337
uses: ./amplify-js/.github/actions/node-and-build
3438

35-
- name: Add changeset preset for all packages
36-
working-directory: ./amplify-js
37-
run: |
38-
# Copy the preset changeset to ensure all packages get versioned
39-
cp .github/changeset-presets/bump-all-packages.md .changeset/
40-
echo "✅ Added changeset preset for unstable release"
41-
42-
- name: Create snapshot versions
43-
working-directory: ./amplify-js
44-
env:
45-
SHA: ${{ github.sha }}
46-
PREID_PREFIX: unstable
47-
run: |
48-
export PREID_HASH_SUFFIX=$(echo $SHA | cut -c -7)
49-
yarn publish:preid
50-
echo "✅ Snapshot versions created with ${PREID_PREFIX}.${PREID_HASH_SUFFIX} identifier"
51-
- name: Publish to npm
52-
working-directory: ./amplify-js
53-
run: |
54-
# Configure npm authentication
55-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
56-
57-
# Publish with unstable dist-tag
58-
yarn changeset publish --tag unstable --no-git-tag
39+
- name: Publish to @unstable
40+
uses: changesets/action@aba318e9165b45b7948c60273e0b72fce0a64eb9 # v1.4.7
41+
with:
42+
cwd: ./amplify-js
43+
publish: yarn publish:unstable
44+
createGithubReleases: false
5945
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6047
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@
2626
"lint:license": "license-check-and-add add -f license_config.json",
2727
"link-all": "yarn unlink-all && yarn workspaces foreach --parallel --no-private run link",
2828
"unlink-all": "yarn workspaces foreach --parallel --no-private run unlink || true",
29-
"publish:preid": "./scripts/preid-env-vars-exist.sh && cp .github/changeset-presets/bump-all-packages.md .changeset/ && yarn changeset pre enter ${PREID_PREFIX}.${PREID_HASH_SUFFIX} && yarn changeset version && yarn changeset publish --tag ${PREID_PREFIX} --no-git-tag",
30-
"publish:verdaccio": "cp .github/changeset-presets/bump-all-packages.md .changeset/ && yarn changeset pre enter unstable && yarn changeset version && yarn changeset publish",
29+
"publish:latest": "changeset publish",
30+
"publish:unstable": "cp .github/changeset-presets/bump-all-packages.md .changeset/ && changeset version --snapshot unstable-$(git rev-parse --short=7 HEAD) && changeset publish --tag unstable --no-git-tag",
31+
"publish:preid": "./scripts/preid-env-vars-exist.sh && cp .github/changeset-presets/bump-all-packages.md .changeset/ && changeset version --snapshot ${PREID}-$(git rev-parse --short=7 HEAD) && changeset version && changeset publish --tag ${PREID} --no-git-tag",
32+
"publish:verdaccio": "yarn publish:unstable",
3133
"generate-metadata": "git rev-parse --short HEAD > packages/core/metadata && git commit -am 'chore(release): Set core metadata [skip release]'",
3234
"ts-coverage": "turbo run ts-coverage",
3335
"prepare": "husky && ./scripts/setup-git-secrets.sh && ./scripts/set-preid-versions.sh"

packages/adapter-nextjs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "1.7.1",
55
"description": "The adapter for the supporting of using Amplify APIs in Next.js.",
66
"peerDependencies": {
7-
"aws-amplify": "^6.13.1",
7+
"aws-amplify": "^6.16.1",
88
"next": ">=13.5.0 <17.0.0"
99
},
1010
"dependencies": {
@@ -14,7 +14,7 @@
1414
"@types/node": "^20.3.1",
1515
"@types/react": "^18.2.13",
1616
"@types/react-dom": "^18.2.6",
17-
"aws-amplify": "6.16.0",
17+
"aws-amplify": "6.16.1",
1818
"jest-fetch-mock": "3.0.3",
1919
"next": ">= 13.5.0 <17.0.0"
2020
},

packages/auth/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## 6.19.0
4+
5+
### Minor Changes
6+
7+
- [`85016ca`](https://github.com/aws-amplify/amplify-js/commit/85016ca4c286157de41a4466238cbe24af30a5d5) Thanks [@soberm](https://github.com/soberm)! - Test change
8+
39
All notable changes to this project will be documented in this file.
410
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
511

packages/auth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aws-amplify/auth",
3-
"version": "6.18.0",
3+
"version": "6.19.0",
44
"description": "Auth category of aws-amplify",
55
"main": "./dist/cjs/index.js",
66
"module": "./dist/esm/index.mjs",

packages/aws-amplify/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Change Log
22

3+
## 6.16.1
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`85016ca`](https://github.com/aws-amplify/amplify-js/commit/85016ca4c286157de41a4466238cbe24af30a5d5)]:
8+
- @aws-amplify/auth@6.19.0
9+
- @aws-amplify/storage@6.13.0
10+
311
All notable changes to this project will be documented in this file.
412
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
513

0 commit comments

Comments
 (0)