forked from amazon-archives/.github
-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
81e7aaf
commit fc16f17
Showing
3 changed files
with
47 additions
and
133 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,125 +1,24 @@ | ||
name: "Build dependency package locally" | ||
description: "Checks out a dependency package locally and updates all references to it" | ||
name: 'Build dependency package locally' | ||
description: 'Checks out a dependency package locally and updates all references to it' | ||
inputs: | ||
package: | ||
description: "Name of the package" | ||
description: 'Name of the package' | ||
required: true | ||
download_dependencies: | ||
description: "Whether to download dependencies" | ||
default: "false" | ||
skip_build: | ||
description: "Whether to skip the build" | ||
default: "false" | ||
skip_tests: | ||
description: "Whether to skip the tests" | ||
default: "false" | ||
target_artifact: | ||
description: "Name of the artifact that will be uploaded" | ||
default: "dependencies" | ||
artifact_path: | ||
description: "Path or pattern for the artifact files that should be uploaded" | ||
|
||
runs: | ||
using: "composite" | ||
using: 'composite' | ||
steps: | ||
- name: Clone | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: cloudscape-design/${{ inputs.package }} | ||
path: ${{ inputs.package }} | ||
- name: Use Node.js 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Download artifacts | ||
if: ${{ inputs.download_dependencies == 'true' }} | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: dependencies | ||
|
||
- run: cd ${{ inputs.package }} | ||
shell: bash | ||
|
||
- uses: cloudscape-design/.github/.github/actions/patch-local-dependencies@main | ||
with: | ||
path: ${{ github.workspace }}/${{ inputs.package }} | ||
type: local | ||
|
||
- name: npm install | ||
shell: bash | ||
run: npm i --force | ||
working-directory: ${{ inputs.package }} | ||
- name: Build | ||
if: ${{ inputs.skip_build != 'true' }} | ||
shell: bash | ||
run: npm run build | ||
working-directory: ${{ inputs.package }} | ||
- name: Test | ||
if: ${{ inputs.skip_tests != 'true' }} | ||
shell: bash | ||
run: npm test | ||
working-directory: ${{ inputs.package }} | ||
- name: Pack artifacts | ||
if: ${{ inputs.package != 'components' && inputs.package != 'test-utils' && inputs.package != 'theming-core' && inputs.package != 'board-components' && inputs.package != 'demos' }} | ||
shell: bash | ||
working-directory: ${{ inputs.package }} | ||
run: | | ||
npm pack | ||
cp *-${{ inputs.package }}-*.tgz $GITHUB_WORKSPACE/${{ inputs.package }}.tgz | ||
- name: Pack test-utils artifacts | ||
if: ${{ inputs.package == 'test-utils' }} | ||
shell: bash | ||
working-directory: ${{ inputs.package }} | ||
run: | | ||
cd packages/core | ||
npm pack | ||
cp *-test-utils-core-*.tgz $GITHUB_WORKSPACE | ||
cd ../converter | ||
npm pack | ||
echo $GITHUB_WORKSPACE | ||
cp *-test-utils-converter-*.tgz $GITHUB_WORKSPACE | ||
cd $GITHUB_WORKSPACE | ||
mv *-test-utils-converter-*.tgz test-utils-converter.tgz | ||
mv *-test-utils-core-*.tgz test-utils-core.tgz | ||
- name: Pack theming-core artifacts | ||
if: ${{ inputs.package == 'theming-core' }} | ||
shell: bash | ||
working-directory: ${{ inputs.package }} | ||
run: | | ||
cd lib/browser | ||
npm pack | ||
cp *-theming-runtime-*.tgz $GITHUB_WORKSPACE | ||
cd ../node | ||
npm pack | ||
echo $GITHUB_WORKSPACE | ||
cp *-theming-build-*.tgz $GITHUB_WORKSPACE | ||
cd $GITHUB_WORKSPACE | ||
mv *-theming-build-*.tgz theming-build.tgz | ||
mv *-theming-runtime-*.tgz theming-runtime.tgz | ||
- name: Package board components files | ||
if: ${{ inputs.package == 'board-components' }} | ||
shell: bash | ||
working-directory: ${{ inputs.package }} | ||
run: | | ||
cd lib/components | ||
npm pack | ||
cp *-${{ inputs.package }}-*.tgz $GITHUB_WORKSPACE/${{ inputs.package }}.tgz | ||
- name: Package component files | ||
if: ${{ inputs.package == 'components' }} | ||
shell: bash | ||
working-directory: ${{ inputs.package }} | ||
run: | | ||
tar -czf ../components-full.tgz . | ||
tar -czf ../components.tgz --directory=lib/components . | ||
tar -czf ../design-tokens.tgz --directory=lib/design-tokens . | ||
uses: ${{ inputs.package }}/.github/workflows/build-lint-test.yml | ||
env: | ||
AWSUI_DRY_RUN: 'true' | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ inputs.target_artifact }} | ||
path: ${{ inputs.artifact_path || format('{0}*.tgz', inputs.package) }} | ||
name: ${{ inputs.package }} | ||
path: '*.tgz' |
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