Skip to content

Commit

Permalink
add poc workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
esauerbo committed Aug 30, 2024
1 parent 0af5fa1 commit e64b0c6
Showing 1 changed file with 5 additions and 62 deletions.
67 changes: 5 additions & 62 deletions .github/workflows/publish-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

# If successful, we will publish all updated UI packages to NPM.

name: Test and Publish / latest
name: POC Test and Publish / latest

on:
push:
branches: [main]
pull_request:
branches: [fix-pub-latest]

permissions:
id-token: write # This is required for requesting the JWT
Expand Down Expand Up @@ -105,62 +105,5 @@ jobs:
- build-test-v2-react-native
if: ${{ needs.setup.outputs.has-changesets != 'true' }}
steps:
- name: Checkout repo
uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62 # v4.1.3 https://github.com/actions/checkout/commit/cd7d8d697e10461458bc61a30d094dc601a8b017
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- 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: Install packages
uses: ./.github/actions/install-with-retries
with:
skip-cypress-binary: true # publishing doesn't need cypress
- name: Build packages
run: yarn build
- name: Publish to @latest
uses: changesets/action@b98cec97583b917ff1dc6179dd4d230d3e439894
with:
publish: yarn publish:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Trigger build for prod liveness sample app pointing at latest tag
run: curl -X POST -d {} $ENDPOINT -H "Content-Type:application/json"
env:
ENDPOINT: ${{ secrets.LIVENESS_PROD_SAMPLE_APP_BUILD_TRIGGER }}

log-failure-metric:
# Send a failure data point to metric PublishLatestFailure in github-workflows@ us-east-2
runs-on: ubuntu-latest
environment: ci
needs: publish
if: ${{ failure() }}
steps:
- name: Log failure data point to metric PublishLatestFailure
uses: aws-amplify/amplify-ui/.github/actions/log-metric@main
with:
metric-name: PublishLatestFailure
value: 1
role-to-assume: ${{ secrets.METRIC_LOGGER_ROLE_ARN }}
aws-region: us-east-2

log-success-metric:
# Send a success data point to metric PublishLatestFailure in github-workflows@ us-east-2
runs-on: ubuntu-latest
environment: ci
needs: publish
if: ${{ success() }}
steps:
- name: Log success data point to metric PublishLatestFailure
uses: aws-amplify/amplify-ui/.github/actions/log-metric@main
with:
metric-name: PublishLatestFailure
value: 0
role-to-assume: ${{ secrets.METRIC_LOGGER_ROLE_ARN }}
aws-region: us-east-2
- name: Fake publish
run: echo "Fake publish"

0 comments on commit e64b0c6

Please sign in to comment.