-
-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dist): automatically run most shell commands
Instead of forcing the user to copy-paste shell commands, run the commands on the user's behalf.
- Loading branch information
Showing
1 changed file
with
38 additions
and
21 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 |
---|---|---|
|
@@ -170,9 +170,12 @@ var Steps []Step = []Step{ | |
if ReleaseCommitHash == "" { | ||
Stopf("missing -ReleaseCommitHash\n") | ||
} | ||
fmt.Printf("Download the build artifacts from the artifact server:\n") | ||
fmt.Printf("$ rsync -av [email protected]:/var/www/c.quick-lint-js.com/builds/%s/ builds/\n", ReleaseCommitHash) | ||
WaitForDone() | ||
RunCommandOrStop( | ||
"rsync", | ||
"-av", | ||
fmt.Sprintf("[email protected]:/var/www/c.quick-lint-js.com/builds/%s/", ReleaseCommitHash), | ||
"builds/", | ||
) | ||
}, | ||
}, | ||
|
||
|
@@ -186,9 +189,15 @@ var Steps []Step = []Step{ | |
Step{ | ||
Title: "Sign the build artifacts", | ||
Run: func() { | ||
fmt.Printf("Sign the build artifacts:\n") | ||
fmt.Printf("$ go run dist/sign-release.go dist/deep-hasher.go dist/appx.go -RelicConfig=dist/certificates/relic-config.yaml builds/ signed-builds/\n") | ||
WaitForDone() | ||
RunCommandOrStop( | ||
"go", "run", | ||
"dist/sign-release.go", | ||
"dist/deep-hasher.go", | ||
"dist/appx.go", | ||
"-RelicConfig=dist/certificates/relic-config.yaml", | ||
"builds/", | ||
"signed-builds/", | ||
) | ||
}, | ||
}, | ||
|
||
|
@@ -220,27 +229,34 @@ var Steps []Step = []Step{ | |
Step{ | ||
Title: "Upload the signed build artifacts", | ||
Run: func() { | ||
fmt.Printf("Upload the signed build artifacts to the artifact server:\n") | ||
fmt.Printf("$ rsync -av signed-builds/ [email protected]:/var/www/c.quick-lint-js.com/releases/%s/\n", ReleaseVersion) | ||
WaitForDone() | ||
RunCommandOrStop( | ||
"rsync", | ||
"-av", | ||
"signed-builds/", | ||
fmt.Sprintf("[email protected]:/var/www/c.quick-lint-js.com/releases/%s/", ReleaseVersion), | ||
) | ||
}, | ||
}, | ||
|
||
Step{ | ||
Title: "Update `latest` symlink", | ||
Run: func() { | ||
fmt.Printf("Update the `latest` symlink on the artifact server:\n") | ||
fmt.Printf("$ ssh [email protected] \"ln --force --no-dereference --symbolic %s /var/www/c.quick-lint-js.com/releases/latest\"\n", ReleaseVersion) | ||
WaitForDone() | ||
RunCommandOrStop( | ||
"ssh", | ||
"[email protected]", | ||
fmt.Sprintf("ln --force --no-dereference --symbolic %s /var/www/c.quick-lint-js.com/releases/latest", ReleaseVersion), | ||
) | ||
}, | ||
}, | ||
|
||
Step{ | ||
Title: "Publish the Visual Studio Code extension to the Marketplace", | ||
Run: func() { | ||
fmt.Printf("With the `vscode/quick-lint-js-*.vsix` artifact:\n") | ||
fmt.Printf("$ npx vsce publish --packagePath signed-builds/vscode/quick-lint-js-%s.vsix\n", ReleaseVersion) | ||
WaitForDone() | ||
RunCommandOrStop( | ||
"npx", "vsce", | ||
"publish", | ||
"--packagePath", fmt.Sprintf("signed-builds/vscode/quick-lint-js-%s.vsix", ReleaseVersion), | ||
) | ||
}, | ||
}, | ||
|
||
|
@@ -256,17 +272,18 @@ var Steps []Step = []Step{ | |
Step{ | ||
Title: "Publish to npm", | ||
Run: func() { | ||
fmt.Printf("With the `npm/quick-lint-js-*.tgz` artifact:\n") | ||
fmt.Printf("$ npm publish signed-builds/npm/quick-lint-js-%s.tgz\n", ReleaseVersion) | ||
WaitForDone() | ||
RunCommandOrStop( | ||
"npm", | ||
"publish", | ||
fmt.Sprintf("signed-builds/npm/quick-lint-js-%s.tgz", ReleaseVersion), | ||
) | ||
}, | ||
}, | ||
|
||
Step{ | ||
Title: "Publish Debian packages", | ||
Run: func() { | ||
fmt.Printf("Run the `dist/debian/sync-releases-to-apt` script.\n") | ||
WaitForDone() | ||
RunCommandOrStop("./dist/debian/sync-releases-to-apt") | ||
}, | ||
}, | ||
|
||
|
@@ -276,7 +293,7 @@ var Steps []Step = []Step{ | |
if ReleaseCommitHash == "" { | ||
Stopf("missing -ReleaseCommitHash\n") | ||
} | ||
fmt.Printf("Publish the website: Run `./website/tools/deploy.sh %s`.\n", ReleaseCommitHash) | ||
RunCommandOrStop("./website/tools/deploy.sh", ReleaseCommitHash) | ||
WaitForDone() | ||
}, | ||
}, | ||
|