Skip to content

Commit

Permalink
Merge pull request #19 from ashwinkumar6/main-feat
Browse files Browse the repository at this point in the history
release (AmplifyJS): AmplifyJS release
  • Loading branch information
ashwinkumar6 authored Nov 17, 2023
2 parents 1f5eefd + 12263ab commit 9fd0cc6
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 268 deletions.
5 changes: 4 additions & 1 deletion .github/actions/npm-publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ inputs:
npm_token:
description: The npm token that gives the job npm permissions
required: true
gh_token:
description: The github token that gives the job permissions to publish release notes on github
required: true

runs:
using: 'composite'
Expand All @@ -31,11 +34,11 @@ runs:
git config --global user.name $GITHUB_USER
- name: Run npm publish
if: github.repository_owner == 'aws-amplify'
shell: bash
working-directory: ./amplify-js
env:
NPM_TOKEN: ${{ inputs.npm_token }}
GH_TOKEN: ${{ inputs.gh_token }}
GH_SHA: ${{ github.sha }}
TARGET: ${{ inputs.target }}
PREID_PREFIX: ${{ inputs.preid || '' }}
Expand Down
67 changes: 37 additions & 30 deletions .github/workflows/callable-npm-publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,52 @@ jobs:
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 https://github.com/actions/checkout/commit/24cb9080177205b6e8c946b17badbe402adc938f
with:
path: amplify-js
token: ${{ secrets.GH_TOKEN_AMPLIFY_JS_WRITE }}

- name: Setup node and build the repository
uses: ./amplify-js/.github/actions/node-and-build

###
# TODO Remove this to enable real NPM interactions.
# <remove>
- name: Load Verdaccio with AmplifyJs
uses: ./amplify-js/.github/actions/load-verdaccio-with-amplify-js
### </remove>

- name: Run npm publish
uses: ./amplify-js/.github/actions/npm-publish
with:
target: release
npm_token: ${{ secrets.NPM_TOKEN }}
gh_token: ${{ secrets.GITHUB_TOKEN }}
github_user: ${{ vars.GH_USER}}
github_email: ${{ vars.GH_EMAIL}}

- name: Set github commit user
env:
GITHUB_EMAIL: ${{ vars.GH_EMAIL }}
GITHUB_USER: ${{ vars.GH_USER }}
run: |
git config --global user.email $GITHUB_EMAIL
git config --global user.name $GITHUB_USER
- name: Update roll-back infrastructure
working-directory: ./amplify-js
run: |
git pull origin release
PUBLISH_COMMIT_HASH=$(git log -n 1 --pretty=format:"%H")
RELEASE_COMMIT_MESSAGE=$(git log -n 1 --skip 1 --pretty=oneline)
if [[ $RELEASE_COMMIT_MESSAGE = *release\(required\)* ]]; then git tag -f required-release $PUBLISH_COMMIT_HASH; fi
- name: Update API documentation
working-directory: ./amplify-js
run: |
yarn run docs
git add ./docs/api/
git commit -m "chore(release): update API docs [ci skip]"
- name: Push post release changes
working-directory: ./amplify-js
run: |
git push origin release
if [ $(git tag -l "required-release") ]; then git push -f origin required-release; fi
git push --force-with-lease origin release:main
# - name: Set github commit user
# env:
# GITHUB_EMAIL: ${{ vars.GH_EMAIL }}
# GITHUB_USER: ${{ vars.GH_USER }}
# run: |
# git config --global user.email $GITHUB_EMAIL
# git config --global user.name $GITHUB_USER

# - name: Update roll-back infrastructure
# working-directory: ./amplify-js
# run: |
# git pull origin release
# PUBLISH_COMMIT_HASH=$(git log -n 1 --pretty=format:"%H")
# RELEASE_COMMIT_MESSAGE=$(git log -n 1 --skip 1 --pretty=oneline)
# if [[ $RELEASE_COMMIT_MESSAGE = *release\(required\)* ]]; then git tag -f required-release $PUBLISH_COMMIT_HASH; fi

# - name: Update API documentation
# working-directory: ./amplify-js
# run: |
# yarn run docs
# git add ./docs/api/
# git commit -m "chore(release): update API docs [ci skip]"

# - name: Push post release changes
# working-directory: ./amplify-js
# run: |
# git push origin release
# if [ $(git tag -l "required-release") ]; then git push -f origin required-release; fi
# git push --force-with-lease origin release:main
27 changes: 17 additions & 10 deletions .github/workflows/push-main-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,21 @@ on:
- main

jobs:
e2e:
# e2e:
# secrets: inherit
# uses: ./.github/workflows/callable-release-verification.yml
# unstable-release:
# needs:
# - e2e
# secrets: inherit
# uses: ./.github/workflows/callable-npm-publish-preid.yml
# with:
# preid: unstable
# allow-protected-preid: true
release:
# needs:
# - e2e
permissions:
contents: write
secrets: inherit
uses: ./.github/workflows/callable-release-verification.yml
unstable-release:
needs:
- e2e
secrets: inherit
uses: ./.github/workflows/callable-npm-publish-preid.yml
with:
preid: unstable
allow-protected-preid: true
uses: ./.github/workflows/callable-npm-publish-release.yml
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"unlink-all": "lerna exec --no-bail --parallel -- yarn unlink; exit 0",
"publish:preid": "./scripts/preid-env-vars-exist.sh && lerna publish --canary --force-publish --dist-tag=${PREID_PREFIX} --preid=${PREID_PREFIX}${PREID_HASH_SUFFIX} --yes",
"publish:main": "lerna publish --canary --force-publish --dist-tag=unstable --preid=unstable${PREID_HASH_SUFFIX} --yes",
"publish:release": "lerna publish --conventional-commits --dist-tag=v6 --message 'chore(release): Publish [ci skip]' --yes",
"publish:release": "lerna publish --conventional-commits --message 'chore(release): Publish [ci skip]' --yes",
"publish:release:new": "lerna publish --conventional-commits --create-release github --message 'chore(release): Publish [ci skip]' --yes",
"publish:v5-stable": "lerna publish --conventional-commits --yes --dist-tag=stable-5 --message 'chore(release): Publish [ci skip]' --no-verify-access",
"publish:verdaccio": "lerna publish --canary --force-publish --no-push --dist-tag=unstable --preid=unstable --yes",
"ts-coverage": "lerna run ts-coverage",
Expand Down
16 changes: 0 additions & 16 deletions packages/auth/__tests__/utils/getAuthUserAgentDetails.test.ts

This file was deleted.

210 changes: 0 additions & 210 deletions packages/storage/__tests__/providers/s3/apis/copy.test.ts

This file was deleted.

0 comments on commit 9fd0cc6

Please sign in to comment.