Skip to content

Commit f2e6578

Browse files
committed
chore: update workflows
1 parent be0ce16 commit f2e6578

File tree

4 files changed

+74
-19
lines changed

4 files changed

+74
-19
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ updates:
99
directory: '/' # Location of package manifests
1010
schedule:
1111
interval: 'weekly'
12-
labels:
13-
- 'USER STORY'
1412
ignore:
1513
# As a library, we intentionally avoid updating TypeScript and @types/node so that we
1614
# don't accidentally use features from a version newer than our downstream users have installed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Label Dependabot PRs
2+
3+
on:
4+
pull_request:
5+
types: [opened]
6+
7+
jobs:
8+
label:
9+
if: github.actor == 'dependabot[bot]'
10+
runs-on: ubuntu-latest
11+
permissions:
12+
pull-requests: write
13+
steps:
14+
- name: Add label if missing
15+
uses: actions/github-script@v7
16+
with:
17+
script: |
18+
const label = 'USER STORY';
19+
const { data: labels } = await github.rest.issues.listLabelsOnIssue({
20+
owner: context.repo.owner,
21+
repo: context.repo.repo,
22+
issue_number: context.issue.number,
23+
});
24+
if (!labels.some(l => l.name === label)) {
25+
await github.rest.issues.addLabels({
26+
owner: context.repo.owner,
27+
repo: context.repo.repo,
28+
issue_number: context.issue.number,
29+
labels: [label],
30+
});
31+
}

.github/workflows/release.yml

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ permissions:
2828
jobs:
2929
release:
3030
# Allow only on master, spring*, summer*, winter*;
31-
if: ${{ github.repository_owner == 'salesforce' && (github.ref_name == 'master' || startsWith(github.ref_name, 'spring') || startsWith(github.ref_name, 'summer') || startsWith(github.ref_name, 'winter')) }}
31+
if: ${{ github.repository_owner == 'salesforce' }}
3232
name: Release LWC - ${{ inputs.release_version }} ${{ inputs.bump }}
3333
environment: release
3434
runs-on: ubuntu-latest
@@ -44,8 +44,23 @@ jobs:
4444
exit 1
4545
fi
4646
fi
47-
echo "Resolved input: '$RELEASE_VERSION'"
47+
48+
if [ "$RELEASE_VERSION" = prerelease ]; then
49+
TAG=canary
50+
else
51+
case "$GITHUB_REF_NAME" in
52+
master) TAG=latest;;
53+
winter*) TAG="$GITHUB_REF_NAME";;
54+
spring*) TAG="$GITHUB_REF_NAME";;
55+
summer*) TAG="$GITHUB_REF_NAME";;
56+
*) echo "Could not determine tag for releasing $GITHUB_REF_NAME as v$NEW_VERSION." && exit 1;;
57+
esac
58+
fi
59+
60+
echo "Resolved input: $RELEASE_VERSION"
4861
echo "resolved=$RELEASE_VERSION" >> "$GITHUB_OUTPUT"
62+
echo "Resolved tag: $TAG"
63+
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
4964
5065
- name: Checkout
5166
uses: actions/checkout@v5
@@ -66,42 +81,38 @@ jobs:
6681

6782
- name: Update LWC version
6883
id: update_version
84+
env:
85+
VERSION_INPUT: ${{ steps.resolve_input.outputs.resolved }}
6986
run: |
7087
71-
node ./scripts/release/version.js '${{ steps.resolve_input.outputs.resolved }}'
88+
node ./scripts/release/version.js "$VERSION_INPUT"
7289
RESOLVED_VERSION="$(jq -r .version package.json)"
7390
echo "New version: $RESOLVED_VERSION"
7491
echo "new_version=$RESOLVED_VERSION" >> "$GITHUB_OUTPUT"
7592
93+
- name: Build
94+
run: yarn build
95+
7696
- name: Set git identity (Actions bot)
97+
if: ${{ steps.resolve_input.outputs.resolved != 'prerelease' }}
7798
run: |
7899
git config user.name "github-actions[bot]"
79100
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
80101
81102
- name: Commit & push
103+
if: ${{ steps.resolve_input.outputs.resolved != 'prerelease' }}
82104
uses: actions-js/push@v1.4
83105
with:
84106
github_token: ${{ secrets.WORKFLOW_PAT }}
85107
branch: ${{ github.ref_name }}
86108
message: 'chore: release v${{ steps.update_version.outputs.new_version }}'
87109

88-
- name: Build
89-
run: yarn build
90-
91-
- name: Tag and create GitHub release
92-
env:
93-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95-
run: |
96-
VERSION='${{ steps.update_version.outputs.new_version }}'
97-
git tag -a "v$VERSION" -m "Release v$VERSION"
98-
git push origin tag "v$VERSION"
99-
gh release create "v$VERSION" --title "v$VERSION" --generate-notes
100-
101110
- name: Publish to npm
102111
env:
112+
NEW_VERSION: ${{ steps.update_version.outputs.new_version }}
103113
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
104114
NPM_CONFIG_ALWAYS_AUTH: 'true'
115+
TAG: ${{ steps.resolve_input.outputs.tag }}
105116
run: |
106117
# Force both npm and yarn to use npmjs and pick up the token
107118
yarn config set registry https://registry.npmjs.org
@@ -112,5 +123,16 @@ jobs:
112123
echo "yarn registry: $(yarn config get registry)"
113124
echo "npm registry: $(npm config get registry)"
114125
115-
TAG=$([ "$GITHUB_REF_NAME" = "master" ] && echo latest || echo "$GITHUB_REF_NAME")
126+
echo "Publishing $GITHUB_REF_NAME as v$NEW_VERSION using tag $TAG."
116127
yarn nx release publish --yes --tag "$TAG"
128+
129+
- name: Tag and create GitHub release
130+
if: ${{ steps.resolve_input.outputs.resolved != 'prerelease' }}
131+
env:
132+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
133+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
134+
VERSION: ${{ steps.update_version.outputs.new_version }}
135+
run: |
136+
git tag -a "v$VERSION" -m "Release v$VERSION"
137+
git push origin tag "v$VERSION"
138+
gh release create "v$VERSION" --title "v$VERSION" --generate-notes

.github/workflows/web-test-runner.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,14 @@ jobs:
110110
continue-on-error: true
111111
run: yarn test
112112
working-directory: packages/@lwc/integration-wtr
113+
timeout-minutes: 35
113114

114115
# Because sometimes things are flaky
115116
- name: Run integration tests (fallback)
116117
if: ${{ steps.test-integration.outcome == 'failure' }}
117118
run: yarn run test
118119
working-directory: packages/@lwc/integration-wtr
120+
timeout-minutes: 35
119121

120122
- name: Upload coverage report
121123
# Upload coverage even if the test step failed
@@ -203,12 +205,14 @@ jobs:
203205
continue-on-error: true
204206
run: yarn run test:hydration
205207
working-directory: packages/@lwc/integration-wtr
208+
timeout-minutes: 35
206209

207210
# Because sometimes things are flaky
208211
- name: Run hydration tests (fallback)
209212
if: ${{ steps.test-hydration.outcome == 'failure' }}
210213
run: yarn run test:hydration
211214
working-directory: packages/@lwc/integration-wtr
215+
timeout-minutes: 35
212216

213217
- name: Upload coverage report
214218
# Upload coverage even if the test step failed

0 commit comments

Comments
 (0)