Skip to content

Commit da65407

Browse files
committed
Update release workflow
1 parent b3b1d14 commit da65407

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v2
22-
with:
23-
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
24-
fetch-depth: 0
2522

2623
- name: Setup Node.js 16.x
2724
uses: actions/setup-node@v2
@@ -36,7 +33,8 @@ jobs:
3633
env:
3734
NODE_OPTIONS: "--max-old-space-size=4096" # Increase heap size for jest
3835

39-
- name: Create Release Pull Request
36+
- name: Create Release Pull Request or Publish Packages
37+
id: changesets
4038
uses: changesets/action@master
4139
with:
4240
publish: npm run release
@@ -60,6 +58,7 @@ jobs:
6058
for (const { name: tag, version } of publishedPackages) {
6159
// Only upload the dist archive for the chore package, plugins, and extensions
6260
if (tag.startsWith("jspsych@") || tag.includes("/plugin-") || tag.includes("/extension-")) {
61+
console.log(`Uploading dist archive release asset for ${tag}`);
6362
try {
6463
// https://docs.github.com/en/rest/reference/repos#get-a-release-by-tag-name
6564
const releaseId = (
@@ -79,11 +78,7 @@ jobs:
7978
// Tag to filename transformation:
8079
// * [email protected] => jspsych-1.2.3-dist.zip
8180
// * @jspsych/[email protected] => jspsych-plugin-test-1.2.3-dist.zip
82-
// * @jspsych-contrib/[email protected] => jspsych-contrib-plugin-test-1.2.3-dist.zip
83-
name: `${tag
84-
.replace("@jspsych/", "jspsych-")
85-
.replace("@jspsych-contrib/", "jspsych-contrib-")
86-
.replace("@", "-")}-dist.zip`,
81+
name: `${tag.replace("@jspsych/", "jspsych-").replace("@", "-")}-dist.zip`,
8782
8883
label: "Dist archive (zip)",
8984
headers: {
@@ -101,4 +96,6 @@ jobs:
10196
10297
if (errorMessage) {
10398
core.setFailed(errorMessage);
99+
} else {
100+
console.log(`Release assets successfully uploaded`);
104101
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"npm": ">=7.0.0"
2020
},
2121
"devDependencies": {
22-
"@changesets/changelog-github": "^0.4.0",
23-
"@changesets/cli": "^2.16.0",
22+
"@changesets/changelog-github": "^0.4.1",
23+
"@changesets/cli": "^2.17.0",
2424
"husky": "^7.0.1",
2525
"import-sort-style-module": "^6.0.0",
2626
"lint-staged": "^11.1.2",

0 commit comments

Comments
 (0)