Skip to content

Commit 73d3c75

Browse files
authored
Merge pull request #1517 from SalesforceCommerceCloud/prep-release-3.2.0
Release SDK 3.2.0-preview.0
2 parents 0194d62 + 7bd0938 commit 73d3c75

File tree

93 files changed

+2751
-878
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+2751
-878
lines changed

.github/actions/create_mrt/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ inputs:
44
description: "Mobify user email"
55
mobify_api_key:
66
description: "Mobify user API key"
7+
cwd:
8+
required: false
9+
default: ${PWD}
710
runs:
811
using: composite
912
steps:
1013
- name: Create MRT credentials file
14+
working-directory: ${{ inputs.cwd }}
1115
run: |-
1216
# Add credentials file at ~/.mobify so we can upload to Mobify Cloud
1317
npm run save-credentials --prefix packages/template-retail-react-app -- --user "${{inputs.mobify_user}}" --key "${{inputs.mobify_api_key}}"

.github/actions/e2e_generate_app/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ inputs:
44
description: Project key to specify project to generate ("retail-app-demo", "retail-app-ext" or "retail-app-no-ext")
55
required: true
66
type: string
7+
cwd:
8+
required: false
9+
default: ${PWD}
710
runs:
811
using: composite
912
steps:
1013
- name: Generate new project based on project-key
14+
working-directory: ${{ inputs.cwd }}
1115
run: node e2e/scripts/generate-project.js ${{ inputs.PROJECT_KEY }}
1216
shell: bash

.github/actions/e2e_validate_generated_app/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ inputs:
44
description: Project key to specify project to validate ("retail-app-demo", "retail-app-ext" or "retail-app-no-ext")
55
required: true
66
type: string
7+
cwd:
8+
required: false
9+
default: ${PWD}
710
runs:
811
using: composite
912
steps:
1013
- name: Validate generated project based on project-key
14+
working-directory: ${{ inputs.cwd }}
1115
run: node e2e/scripts/validate-generated-project.js ${{ inputs.PROJECT_KEY }}
1216
shell: bash

.github/actions/push_to_mrt/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ inputs:
44
description: Project directory
55
TARGET:
66
description: MRT target
7+
FLAGS:
8+
description: Push flags
79
runs:
810
using: composite
911
steps:
@@ -13,6 +15,6 @@ runs:
1315
project="scaffold-pwa"
1416
build="build ${{ github.run_id }} on ${{ github.ref }} (${{ github.sha }})"
1517
if [[ ${{ inputs.TARGET }} ]]; then
16-
npm run push -- -s $project --message "$build" --target ${{ inputs.TARGET }}
18+
npm run push -- -s $project --message "$build" --target ${{ inputs.TARGET }} ${{ inputs.FLAGS }}
1719
fi
1820
shell: bash

.github/actions/setup_ubuntu/action.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ name: setup_ubuntu
22
inputs:
33
cwd:
44
required: false
5-
default: "${PWD}"
5+
default: ${{ github.workspace }}
66
description: "Setup Ubuntu Machine"
77
runs:
88
using: composite
99
steps:
1010
- name: Install Dependencies
11+
working-directory: ${{ inputs.cwd }}
1112
run: |-
1213
# Install system dependencies
1314
sudo apt-get update -yq
@@ -24,11 +25,8 @@ runs:
2425
# Report bundle sizes
2526
node ./scripts/report-bundle-size.js
2627
27-
# Check that packages are all using the same versions of npm dependencies
28-
npm run check-dep-version
29-
3028
# Install Snyk CLI
31-
# TODO: Ticket W-12425059. Revisit Snyk CLI integration to monitor manifest files on generated projects.
29+
# TODO: Ticket W-12425059. Revisit Snyk CLI integration to monitor manifest files on generated projects.
3230
# TODO: Latest Snyk CLI version is currently failing on npm i. We use the alternative Snyk GitHub integration.
3331
# sudo npm install -g snyk
3432

.github/actions/wait_for_mrt_deploy/action.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/e2e.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,7 @@ jobs:
103103
with:
104104
CWD: "../generated-projects/retail-app-no-ext"
105105
TARGET: e2e-tests-pwa-kit
106-
107-
- name: Wait for MRT Deploy to complete
108-
uses: "./.github/actions/wait_for_mrt_deploy"
109-
with:
110-
TARGET: e2e-tests-pwa-kit
111-
MRT_API_KEY: ${{ secrets.MOBIFY_CLIENT_API_KEY }}
112-
VERSION: ${{ github.sha }}
113-
PROJECT: scaffold-pwa
106+
FLAGS: --wait
114107

115108
- name: Install Playwright Browsers
116109
run: npx playwright install --with-deps
@@ -182,14 +175,7 @@ jobs:
182175
with:
183176
CWD: "../generated-projects/retail-app-ext"
184177
TARGET: e2e-tests-pwa-kit
185-
186-
- name: Wait for MRT Deploy to complete
187-
uses: "./.github/actions/wait_for_mrt_deploy"
188-
with:
189-
TARGET: e2e-tests-pwa-kit
190-
MRT_API_KEY: ${{ secrets.MOBIFY_CLIENT_API_KEY }}
191-
VERSION: ${{ github.sha }}
192-
PROJECT: scaffold-pwa
178+
FLAGS: --wait
193179

194180
- name: Install Playwright Browsers
195181
run: npx playwright install --with-deps
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: SalesforceCommerceCloud/pwa-kit/nightly_release
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
# Run weekdays at 12am (PST) - cron uses UTC times
6+
- cron: "0 8 * * 1-5"
7+
8+
jobs:
9+
create_nightly_release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Get Timestamp
20+
run: |-
21+
echo "release_timestamp=$(date +'%Y%m%d%H%M%S')" >> "$GITHUB_ENV"
22+
23+
- name: Get monorepo version
24+
run: |-
25+
version=`jq -r ".version" package.json | cut -d "-" -f 1`
26+
echo "monorepo_version_base=$version" >> "$GITHUB_ENV"
27+
version_major=`echo "$version" | cut -d "." -f 1`
28+
echo "monorepo_version_major=$version_major" >> "$GITHUB_ENV"
29+
echo "nightly_version=${{ env.monorepo_version_base }}-nightly-${{ env.release_timestamp }}" ?? "$GITHUB_ENV"
30+
31+
- name: Get nightly version
32+
run: echo "nightly_version=${{ env.monorepo_version_base }}-nightly-${{ env.release_timestamp }}" >> "$GITHUB_ENV"
33+
34+
- name: Get retail-react-app version
35+
run: |-
36+
version=`jq -r ".version" packages/template-retail-react-app/package.json | cut -d "-" -f 1`
37+
echo "retail_app_version_base=$version" >> "$GITHUB_ENV"
38+
39+
- name: Get commerce-sdk-react version
40+
run: |-
41+
version=`jq -r ".version" packages/commerce-sdk-react/package.json | cut -d "-" -f 1`
42+
echo "commerce_sdk_react_version_base=$version" >> "$GITHUB_ENV"
43+
44+
- name: Setup Node
45+
uses: actions/setup-node@v3
46+
with:
47+
node-version: 18
48+
cache: npm
49+
50+
- name: Install Monorepo Dependencies
51+
run: |-
52+
# Install node dependencies
53+
node ./scripts/gtime.js monorepo_install npm ci
54+
55+
- name: Update identity in git config
56+
run: |-
57+
git config --global user.name ${{ secrets.GIT_CONFIG_USERNAME }}
58+
git config --global user.email ${{ secrets.GIT_CONFIG_EMAIL }}
59+
60+
- name: Create Release Branch
61+
run: |-
62+
git pull
63+
git switch develop
64+
git switch nightly-releases || git switch -c nightly-releases
65+
66+
# Pull all changes from develop and keep changes from develop in case of merge-conflicts
67+
- name: Pull latest changes from develop
68+
run: |-
69+
git switch develop
70+
git merge -s ours nightly-releases
71+
git switch nightly-releases
72+
git merge develop
73+
74+
- name: Bump version (monorepo)
75+
run: |-
76+
npm run bump-version -- "${{ env.nightly_version }}"
77+
78+
- name: Bump version (retail-react-app)
79+
run: |-
80+
npm run bump-version:retail-react-app -- "${{ env.retail_app_version_base }}-nightly-${{ env.release_timestamp }}"
81+
82+
- name: Bump version (commerce-sdk-react)
83+
run: |-
84+
npm run bump-version:commerce-sdk-react -- "${{ env.commerce_sdk_react_version_base }}-nightly-${{ env.release_timestamp }}"
85+
86+
- name: Push version changes to origin
87+
run: |-
88+
git commit -am "Release ${{ env.nightly_version }}"
89+
git push --set-upstream origin nightly-releases
90+
91+
- name: Check Repository Clean
92+
uses: "./.github/actions/check_clean"
93+
94+
- name: Publish to NPM
95+
uses: "./.github/actions/publish_to_npm"
96+
with:
97+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
98+
99+
- name: Create git tag
100+
run: |-
101+
git tag v${{ env.nightly_version }}
102+
git push origin --tags
103+
104+
- name: Send GitHub Action data to Slack workflow (Generated)
105+
id: slack-success
106+
uses: slackapi/slack-github-action@v1.23.0
107+
with:
108+
payload: |
109+
{
110+
"message": "Successfully released PWA Kit v${{ env.nightly_version }}"
111+
}
112+
env:
113+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
114+
115+
- name: Send GitHub Action data to Slack workflow (Generated)
116+
id: slack-failure
117+
if: ${{ failure() }}
118+
uses: slackapi/slack-github-action@v1.23.0
119+
with:
120+
payload: |
121+
{
122+
"message": "Failed to release PWA Kit v${{ env.monorepo_version_base }}-nightly-${{ env.release_timestamp }} (${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
123+
}
124+
env:
125+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
with:
117117
payload: |
118118
{
119-
"test": "testNode${{ matrix.node }}"
119+
"test": "A 'testNode${{ matrix.node }}' task has failed."
120120
}
121121
env:
122122
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
@@ -251,7 +251,7 @@ jobs:
251251
with:
252252
payload: |
253253
{
254-
"test": "generated ${{ matrix.template }}"
254+
"message": "A 'generated ${{ matrix.template }}' task has failed."
255255
}
256256
env:
257257
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ npm run push -- -m "Message to help you recognize this bundle"
5555

5656
## 🌍 Localization
5757

58-
See the [Localization README.md](./packages/template-retail-react-app/app/translations/README.md) for important setup instructions for localization.
58+
See the [Localization README.md](./packages/template-retail-react-app/translations/README.md) for important setup instructions for localization.
5959

6060
## ⚠️ License Information
6161

@@ -65,6 +65,14 @@ The PWA Kit is licensed under a BSD 3-Clause license. See the [license](./LICENS
6565

6666
Your contributions are welcome! Refer to the [CONTRIBUTING](./CONTRIBUTING.md) guide to get started. If you like `pwa-kit`, consider adding a ⭐ on the [GitHub Repo](https://github.com/SalesforceCommerceCloud/pwa-kit/). It helps other people discover PWA Kit!
6767

68+
## 🛠️ Nightly Builds
69+
70+
⚠️ PWA Kit releases nightly builds on a nightly cadence for better visibility about upcoming features and a chance for implementers to test code integrations via a "preview" release. These builds are untested and unsupported. Use at your own risk!
71+
Nightly builds carry none of our guarantees associated with well-tested software. **Do not use these builds in production**.
72+
Some feature included in the nightly builds may not be included in final PWA Kit releases.
73+
These unreleased builds may not even load, may have undocumented features, known defects, and any number of other issues.
74+
They are intended for use by developers and others wishing to get early access to planned PWA Kit features.
75+
6876
## 📖 Documentation
6977

7078
The full documentation for PWA Kit and Managed Runtime is hosted on the [Salesforce Developers](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/overview) portal.

0 commit comments

Comments
 (0)