From 26dd8dee2d6acdfa51443e9536f9367c5e3c7f40 Mon Sep 17 00:00:00 2001 From: Scott Rees <6165315+reesscot@users.noreply.github.com> Date: Wed, 8 Nov 2023 12:50:36 -0700 Subject: [PATCH] chore: publish a next-release-unstable tag (#4672) --- .github/workflows/build-system-test.yml | 4 +- .../publish-next-release-unstable.yml | 73 +++++++++++++++++++ 2 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish-next-release-unstable.yml diff --git a/.github/workflows/build-system-test.yml b/.github/workflows/build-system-test.yml index ff57794cfb4..f0e07416e3e 100644 --- a/.github/workflows/build-system-test.yml +++ b/.github/workflows/build-system-test.yml @@ -55,9 +55,9 @@ jobs: language: ts node-version: 20 - framework: react - framework-version: 17 + framework-version: 18 build-tool: next - build-tool-version: 11 + build-tool-version: 12 pkg-manager: npm language: ts node-version: 20 diff --git a/.github/workflows/publish-next-release-unstable.yml b/.github/workflows/publish-next-release-unstable.yml new file mode 100644 index 00000000000..f1582c8c275 --- /dev/null +++ b/.github/workflows/publish-next-release-unstable.yml @@ -0,0 +1,73 @@ +# Description: This workflow runs unit + e2e tests, then publishes UI packages +# to `@next-release` NPM tag. +# +# Triggered by: merge to `next-release/main` + +name: Test and Publish / next-release-unstable + +on: + push: + branches: [next-release/main] + +permissions: + id-token: write # This is required for requesting the JWT + contents: read # This is required for actions/checkout + +jobs: + setup-cache: + uses: aws-amplify/amplify-ui/.github/workflows/reusable-setup-cache.yml@next-release/main + with: + commit: ${{ github.sha }} + repository: ${{ github.repository }} + + publish: + uses: ./.github/workflows/reusable-tagged-publish.yml + with: + dist-tag: next-release-unstable + secrets: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + build-test: + needs: publish + runs-on: ubuntu-latest + environment: ci + steps: + - name: Checkout repo + uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 https://github.com/actions/checkout/commit/24cb9080177205b6e8c946b17badbe402adc938f + - name: Setup Node.js 20 + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 https://github.com/actions/setup-node/commit/64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c + with: + node-version: 20 + cache: 'yarn' + env: + SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2 + - name: Add Amplify CLI + run: yarn global add @aws-amplify/cli + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-region: us-east-2 + role-to-assume: ${{ secrets.AUTH_E2E_ROLE_ARN }} + # Amplify CLI does not support headless pull with temporary credentials + # when useProfile is false. + # See: https://github.com/aws-amplify/amplify-cli/issues/11009. + - name: Create temp AWS profile + run: | + aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && \ + aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY && \ + aws configure set aws_session_token $AWS_SESSION_TOKEN && \ + aws configure set default.region $AWS_REGION + - name: Pull down AWS environments + run: yarn pull + working-directory: ./canary + - name: Delete AWS Profile + run: rm -rf ~/.aws + - name: Setup canary apps against @next-release-unstable + run: yarn setup:next-release-unstable + working-directory: ./canary + - name: Run yarn install on each sample app + run: yarn install + working-directory: ./canary + - name: Run yarn build on each sample app + run: yarn build + working-directory: ./canary