Skip to content
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

POC storage browser release workflows #5822

Draft
wants to merge 3 commits into
base: storage-browser-release-workflows
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions .github/workflows/poc-publish-storage-browser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Description: This workflow runs unit + e2e tests, then publishes UI packages
# to `@storage-browser` NPM tag.
#
# Triggered by: merge to `feat-storage-browser/release`

name: POC / Test and Publish / storage-browser

concurrency:
group: e2e-${{ github.sha }}
cancel-in-progress: true

on:
pull_request:
branches: [storage-browser-release-workflows]

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@main
with:
commit: ${{ github.sha }}
repository: ${{ github.repository }}

unit:
uses: aws-amplify/amplify-ui/.github/workflows/reusable-unit.yml@main
needs: setup-cache
with:
commit: ${{ github.sha }}
repository: ${{ github.repository }}

e2e:
uses: aws-amplify/amplify-ui/.github/workflows/reusable-e2e.yml@main
needs: unit
with:
commit: ${{ github.sha }}
repository: ${{ github.repository }}
skip-changed-packages-check: 'true' # always run e2e tests for native platform on main
secrets:
AUTH_E2E_ROLE_ARN: ${{ secrets.AUTH_E2E_ROLE_ARN }}
DATASTORE_E2E_ROLE_ARN: ${{ secrets.DATASTORE_E2E_ROLE_ARN }}
GEO_E2E_ROLE_ARN: ${{ secrets.GEO_E2E_ROLE_ARN }}
STORAGE_E2E_ROLE_ARN: ${{ secrets.STORAGE_E2E_ROLE_ARN }}
LIVENESS_E2E_ROLE_ARN: ${{ secrets.LIVENESS_E2E_ROLE_ARN }}
IN_APP_MESSAGING_E2E_ROLE_ARN: ${{ secrets.IN_APP_MESSAGING_E2E_ROLE_ARN }}
AI_E2E_ROLE_ARN: ${{ secrets.AI_E2E_ROLE_ARN }}
DOMAIN: ${{ secrets.DOMAIN }}
PHONE_NUMBER: ${{ secrets.PHONE_NUMBER }}
USERNAME: ${{ secrets.USERNAME }}
NEW_PASSWORD: ${{ secrets.NEW_PASSWORD }}
VALID_PASSWORD: ${{ secrets.VALID_PASSWORD }}
SITE_URL: ${{ secrets.SITE_URL }}
DOCSEARCH_DOCS_APP_ID: ${{ secrets.DOCSEARCH_DOCS_APP_ID }}
DOCSEARCH_DOCS_API_KEY: ${{ secrets.DOCSEARCH_DOCS_API_KEY }}
DOCSEARCH_DOCS_INDEX_NAME: ${{ secrets.DOCSEARCH_DOCS_INDEX_NAME }}

publish:
runs-on: ubuntu-latest
environment: ci
steps:
- name: Fake publish
run: echo "Fake pubish to storage-browser tag"

build-test-v2:
uses: ./.github/workflows/reusable-build-system-test.yml
needs: publish
with:
dist-tag: storage-browser

build-test-v2-react-native:
uses: ./.github/workflows/reusable-build-system-test-react-native.yml
needs: publish
with:
dist-tag: storage-browser

build-test:
needs: publish
runs-on: ubuntu-latest
environment: ci
steps:
- name: Checkout repo
uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62 # v4.1.3 https://github.com/actions/checkout/commit/cd7d8d697e10461458bc61a30d094dc601a8b017
- name: Setup Node.js 20
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 https://github.com/actions/setup-node/commit/60edb5dd545a775178f52524783378180af0d1f8
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@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 https://github.com/aws-actions/configure-aws-credentials/commit/e3dd6a429d7300a6a4c196c26e071d42e0343502
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 @storage-browser
run: yarn setup:storage-browser
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

Loading