Skip to content

Commit badc81c

Browse files
committed
Set up CI/CD in v2/react branch
1 parent 736cfe7 commit badc81c

File tree

5 files changed

+14
-75
lines changed

5 files changed

+14
-75
lines changed

.github/workflows/publish-latest.yml renamed to .github/workflows/publish-latest-v2.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Publish to latest
1+
name: Publish to latest / v2
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [v2/react]
66

77
permissions:
88
contents: write # Used to push tags to GitHub
@@ -79,7 +79,7 @@ jobs:
7979
- name: Publish to @latest
8080
uses: changesets/action@b98cec97583b917ff1dc6179dd4d230d3e439894
8181
with:
82-
publish: yarn publish:latest
82+
publish: yarn publish:v2
8383
env:
8484
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8585
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test-deploy-main.yml renamed to .github/workflows/test-deploy-v2.yml

Lines changed: 2 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# This workflow will run unit, e2e, and docs tests on commits to main.
22

3-
name: Test and Publish / main
3+
name: Test and Publish / v2
44

55
concurrency:
66
group: e2e-${{ github.sha }}
77
cancel-in-progress: true
88

99
on:
1010
push:
11-
branches: [main]
11+
branches: [v2/react]
1212

1313
jobs:
1414
test:
@@ -100,66 +100,3 @@ jobs:
100100
USERNAME: ${{ secrets.USERNAME }}
101101
NEW_PASSWORD: ${{ secrets.NEW_PASSWORD }}
102102
VALID_PASSWORD: ${{ secrets.VALID_PASSWORD }}
103-
104-
publish:
105-
needs: guides
106-
runs-on: ubuntu-latest
107-
environment: deployment
108-
steps:
109-
- name: Checkout repo
110-
uses: actions/checkout@v3
111-
- name: Setup Node.js LTS
112-
uses: actions/setup-node@v2
113-
with:
114-
node-version: lts/*
115-
cache: 'yarn'
116-
- name: Install and build packages
117-
run: yarn --frozen-lockfile && yarn build
118-
- name: Add changeset that bumps all public packages
119-
# There needs to be a changeset for @aws-amplify/ui[-framework] to publish.
120-
run: cp .github/changeset-presets/bump-versions.md .changeset
121-
- name: Run changeset version to next tag
122-
run: yarn version:next
123-
env:
124-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125-
- name: Create .npmrc
126-
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
127-
env:
128-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
129-
- name: Publish to next tag
130-
run: yarn publish:next
131-
132-
build-test:
133-
needs: publish
134-
runs-on: ubuntu-latest
135-
environment: ci
136-
steps:
137-
- name: Checkout repo
138-
uses: actions/checkout@v3
139-
- name: Add Amplify CLI
140-
run: yarn global add @aws-amplify/cli
141-
- name: Get CLI versions
142-
id: cli-version
143-
run: echo "::set-output name=version::$(amplify --version)"
144-
- name: Create or restore environments cache
145-
id: environments-cache
146-
uses: actions/cache@v2
147-
with:
148-
path: canary/environments/**/aws-exports.js
149-
key: ${{ runner.os }}-canary-environments-${{ steps.cli-version.outputs.version }}-${{ hashFiles('canary/environments/**/amplify/**') }}
150-
- name: Pull down AWS environments
151-
if: steps.environments-cache.outputs.cache-hit != 'true'
152-
run: yarn pull
153-
env:
154-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
155-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
156-
working-directory: ./canary
157-
- name: Setup canary apps against @next
158-
run: yarn setup:next
159-
working-directory: ./canary
160-
- name: Run yarn install on each sample app
161-
run: yarn install
162-
working-directory: ./canary
163-
- name: Run yarn build on each sample app
164-
run: yarn build
165-
working-directory: ./canary

.github/workflows/test-prs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ concurrency:
77
cancel-in-progress: true
88

99
on:
10-
pull_request_target:
11-
branches: [main, ui-svelte/main, ui-geo/main]
10+
pull_request: # not pull_request_target, because v2 is in maintenance mode and will not accept external pull requests
11+
branches: [v2/react]
1212
types: [opened, synchronize, labeled]
1313

1414
permissions:
@@ -35,7 +35,7 @@ jobs:
3535
const label = 'run-tests';
3636
github.issues.removeLabel({ owner, repo, issue_number, name: label });
3737
test:
38-
uses: aws-amplify/amplify-ui/.github/workflows/reusable-e2e.yml@main
38+
uses: aws-amplify/amplify-ui/.github/workflows/reusable-e2e.yml@v2/react
3939
needs: setup
4040
with:
4141
commit: ${{ github.event.pull_request.head.sha }}

.github/workflows/version-packages.yml renamed to .github/workflows/version-packages-v2.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Version Packages
1+
name: Version Packages / v2
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [v2/react]
66

77
permissions:
88
contents: write # Used to commit to "Version Packages" PR
@@ -34,5 +34,7 @@ jobs:
3434
- name: Create or update Version Packages PR
3535
if: ${{ steps.has-changesets.outputs.has-changesets == 'true' }}
3636
uses: changesets/action@b98cec97583b917ff1dc6179dd4d230d3e439894
37+
with:
38+
title: 'Version Packages (ui-react@v2)'
3739
env:
3840
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
"publish:next": "yarn changeset publish --tag next",
2424
"version:studio": "yarn changeset version --snapshot studio-$(git rev-parse --short=7 HEAD) && yarn angular build",
2525
"publish:studio": "yarn changeset publish --tag studio",
26-
"version:latest": "yarn changeset version && yarn angular build",
27-
"publish:latest": "yarn changeset publish"
26+
"version:v2": "yarn changeset version && yarn angular build",
27+
"publish:v2": "yarn changeset publish"
2828
},
2929
"workspaces": {
3030
"packages": [

0 commit comments

Comments
 (0)