-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
686 changed files
with
125,446 additions
and
14,092 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Load Verdaccio with AmplifyJs | ||
description: Turn on Verdaccio and load up all of the AmplifyJS build artifacts | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Start verdaccio | ||
run: | | ||
npx [email protected] & | ||
while ! nc -z localhost 4873; do | ||
echo "Verdaccio not running yet" | ||
sleep 1 | ||
done | ||
# Run your commands after verdaccio is up and running | ||
echo "Verdaccio is up and running, proceeding with the script..." | ||
shell: bash | ||
- name: Install and run npm-cli-login | ||
shell: bash | ||
env: | ||
NPM_REGISTRY: http://localhost:4873/ | ||
NPM_USER: verdaccio | ||
NPM_PASS: verdaccio | ||
NPM_EMAIL: [email protected] | ||
run: | | ||
npm i -g npm-cli-adduser | ||
npm-cli-adduser | ||
sleep 1 | ||
- name: Configure registry and git | ||
shell: bash | ||
working-directory: ./amplify-js | ||
env: | ||
NPM_REGISTRY: http://localhost:4873/ | ||
NPM_USER: verdaccio | ||
NPM_PASS: verdaccio | ||
NPM_EMAIL: [email protected] | ||
run: | | ||
yarn config set registry $NPM_REGISTRY | ||
npm set registry $NPM_REGISTRY | ||
git config --global user.email $NPM_EMAIL | ||
git config --global user.name $NPM_USER | ||
git status | ||
git --no-pager diff | ||
- name: Publish to verdaccio | ||
shell: bash | ||
working-directory: ./amplify-js | ||
run: | | ||
scripts/retry-yarn-script.sh -s publish:verdaccio -n 5 -r true | ||
yarn info aws-amplify@unstable description | ||
npm info aws-amplify@unstable version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Set Node and Build | ||
description: Checks out Amplify and builds the package | ||
inputs: | ||
is-prebuild: | ||
required: false | ||
default: false | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Setup Node.js 16 | ||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 https://github.com/actions/setup-node/commit/64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c | ||
with: | ||
node-version: 16 | ||
env: | ||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2 | ||
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 | ||
id: cache-build-artifacts | ||
with: | ||
path: | | ||
**/node_modules | ||
**/dist | ||
**/lib | ||
**/lib-esm/ | ||
**/es/ | ||
**/esm/ | ||
**/cjs/ | ||
**/packages/core/src/Platform/version.ts | ||
key: ${{ runner.os }}-build-artifacts-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-build-artifacts- | ||
env: | ||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2 | ||
# TODO We should be able to skip yarn / bootstrap if we cache enough things. Leaving because skipping causes issues. | ||
- name: Install | ||
if: inputs.is-prebuild != 'true' || steps.cache-build-artifacts.outputs.cache-hit != 'true' | ||
run: yarn | ||
shell: bash | ||
working-directory: ./amplify-js | ||
- name: Bootstrap | ||
if: inputs.is-prebuild != 'true' || steps.cache-build-artifacts.outputs.cache-hit != 'true' | ||
run: yarn bootstrap | ||
shell: bash | ||
working-directory: ./amplify-js | ||
- name: Build packages | ||
if: steps.cache-build-artifacts.outputs.cache-hit != 'true' | ||
run: yarn build | ||
shell: bash | ||
working-directory: ./amplify-js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Publish to NPM | ||
description: Publish changes from the current commit to npm using the target release process. | ||
|
||
inputs: | ||
github_user: | ||
description: The git user to make commits with | ||
required: true | ||
github_email: | ||
description: The git email to make commits with | ||
required: true | ||
target: | ||
description: The release process target (either release or preid) | ||
required: true | ||
preid: | ||
description: The preid to release to when the target is preid. The preid process will fail if this isn't provided. | ||
required: false | ||
npm_token: | ||
description: The npm token that gives the job npm permissions | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Set github commit user | ||
shell: bash | ||
env: | ||
GITHUB_EMAIL: ${{ inputs.github_email }} | ||
GITHUB_USER: ${{ inputs.github_user }} | ||
run: | | ||
git config --global user.email $GITHUB_EMAIL | ||
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_SHA: ${{ github.sha }} | ||
TARGET: ${{ inputs.target }} | ||
PREID_PREFIX: ${{ inputs.preid || '' }} | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc | ||
export PREID_HASH_SUFFIX=$(echo $GH_SHA | cut -c -7 | sed 's/^/\./') | ||
git status | ||
git --no-pager diff | ||
yarn publish:$TARGET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Setup Amplify Integration Test Package | ||
description: Checks out "amplify-js-samples-staging" and builds the package with caching | ||
|
||
inputs: | ||
GH_TOKEN_STAGING_READ: | ||
description: The token that grants read access to the sample staging repo | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Create cache | ||
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 https://github.com/actions/cache/commit/88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 | ||
id: cache-samples-staging-build | ||
with: | ||
key: aws-amplify-js-samples-staging-build-${{ github.sha }} | ||
path: | | ||
./amplify-js-samples-staging/node_modules | ||
/home/runner/.cache/Cypress | ||
env: | ||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2 | ||
- name: Checkout staging repo | ||
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 https://github.com/actions/checkout/commit/24cb9080177205b6e8c946b17badbe402adc938f | ||
with: | ||
repository: ${{ github.repository_owner }}/amplify-js-samples-staging | ||
path: amplify-js-samples-staging | ||
token: ${{ inputs.GH_TOKEN_STAGING_READ }} | ||
|
||
# We test on the staging branch that corresponds to the amplify-js branch | ||
# when it exists and test on the default branch `main` otherwise | ||
- name: Staging repo branch selection | ||
shell: bash | ||
working-directory: ./amplify-js-samples-staging | ||
env: | ||
BRANCH: ${{ github.ref_name }} | ||
run: | | ||
if git ls-remote --exit-code --heads origin $BRANCH >/dev/null 2>&1; then | ||
# Branch exists, checkout and echo success message | ||
git fetch origin $BRANCH | ||
git checkout $BRANCH | ||
echo "Checked out branch: $BRANCH" | ||
else | ||
# Branch doesn't exist, echo error message | ||
echo "Branch '$BRANCH' does not exist" | ||
fi | ||
- name: Install | ||
run: | | ||
yarn | ||
shell: bash | ||
working-directory: ./amplify-js-samples-staging |
Oops, something went wrong.