CI overhaul based on GitHub Actions
This replaces Travis (for Linux & Mac) and Appveyor (for Windows) with
GitHub Actions. In addition to using GitHub Actions to test PRs, this
also expands the automation of releases so that the only manual steps
are:
1. Create a new CHANGELOG.md entry
2. Create a release tag
Workflows have been create for building and testing PRs and releases,
for publishing releases to GitHub, NPM, and Docker Hub, and for
updating documentation on GitHub Pages.
When a new PR is created, GitHub Actions will:
- Build and test on all combinations of OS, release type, and library
type
Appveyor's workflow took ~2 hours, whereas the new GitHub Actions
workflow takes ~30 minutes.
When a new release tag is created, GitHub Actions will:
- Create a draft release on GitHub
- Extract release notes from CHANGELOG.md & attach them to the
draft release
- Build and test on all combinations of OS, release type, and library
type, aborting if any build or test fails
- Attach release artifacts to the draft release, aborting if any
one artifact can't be prepared
- Fully publish the draft release on GitHub
- Publish the same release to NPM (triggered by GitHub release)
- Publish the same release to Docker Hub (triggered by GitHub release)
- Update the docs on GitHub pages
Closes #336 (GitHub Actions workflow to replace Travis and Appveyor)
b/190743862 (internal; tracking replacement of Travis)
Change-Id: Ic53eef60a8587c5d1487769a0cefaa16eb9b46e7
2021-06-10 21:40:14 +00:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
// Modules we use:
|
|
|
|
var path = require('path');
|
|
|
|
var spawnSync = require('child_process').spawnSync;
|
|
|
|
|
2023-12-01 17:32:19 +00:00
|
|
|
// Command names per-platform (process.platform) and per-architecture
|
|
|
|
// (process.arch):
|
CI overhaul based on GitHub Actions
This replaces Travis (for Linux & Mac) and Appveyor (for Windows) with
GitHub Actions. In addition to using GitHub Actions to test PRs, this
also expands the automation of releases so that the only manual steps
are:
1. Create a new CHANGELOG.md entry
2. Create a release tag
Workflows have been create for building and testing PRs and releases,
for publishing releases to GitHub, NPM, and Docker Hub, and for
updating documentation on GitHub Pages.
When a new PR is created, GitHub Actions will:
- Build and test on all combinations of OS, release type, and library
type
Appveyor's workflow took ~2 hours, whereas the new GitHub Actions
workflow takes ~30 minutes.
When a new release tag is created, GitHub Actions will:
- Create a draft release on GitHub
- Extract release notes from CHANGELOG.md & attach them to the
draft release
- Build and test on all combinations of OS, release type, and library
type, aborting if any build or test fails
- Attach release artifacts to the draft release, aborting if any
one artifact can't be prepared
- Fully publish the draft release on GitHub
- Publish the same release to NPM (triggered by GitHub release)
- Publish the same release to Docker Hub (triggered by GitHub release)
- Update the docs on GitHub pages
Closes #336 (GitHub Actions workflow to replace Travis and Appveyor)
b/190743862 (internal; tracking replacement of Travis)
Change-Id: Ic53eef60a8587c5d1487769a0cefaa16eb9b46e7
2021-06-10 21:40:14 +00:00
|
|
|
var commandNames = {
|
2023-12-01 17:32:19 +00:00
|
|
|
linux: {
|
|
|
|
'x64': 'packager-linux-x64',
|
|
|
|
'arm64': 'packager-linux-arm64',
|
|
|
|
},
|
|
|
|
darwin: {
|
|
|
|
'x64': 'packager-osx-x64',
|
|
|
|
},
|
|
|
|
win32: {
|
|
|
|
'x64': 'packager-win-x64.exe',
|
|
|
|
},
|
CI overhaul based on GitHub Actions
This replaces Travis (for Linux & Mac) and Appveyor (for Windows) with
GitHub Actions. In addition to using GitHub Actions to test PRs, this
also expands the automation of releases so that the only manual steps
are:
1. Create a new CHANGELOG.md entry
2. Create a release tag
Workflows have been create for building and testing PRs and releases,
for publishing releases to GitHub, NPM, and Docker Hub, and for
updating documentation on GitHub Pages.
When a new PR is created, GitHub Actions will:
- Build and test on all combinations of OS, release type, and library
type
Appveyor's workflow took ~2 hours, whereas the new GitHub Actions
workflow takes ~30 minutes.
When a new release tag is created, GitHub Actions will:
- Create a draft release on GitHub
- Extract release notes from CHANGELOG.md & attach them to the
draft release
- Build and test on all combinations of OS, release type, and library
type, aborting if any build or test fails
- Attach release artifacts to the draft release, aborting if any
one artifact can't be prepared
- Fully publish the draft release on GitHub
- Publish the same release to NPM (triggered by GitHub release)
- Publish the same release to Docker Hub (triggered by GitHub release)
- Update the docs on GitHub pages
Closes #336 (GitHub Actions workflow to replace Travis and Appveyor)
b/190743862 (internal; tracking replacement of Travis)
Change-Id: Ic53eef60a8587c5d1487769a0cefaa16eb9b46e7
2021-06-10 21:40:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Find the platform-specific binary:
|
2023-12-01 17:32:19 +00:00
|
|
|
if (!(process.platform in commandNames)) {
|
|
|
|
throw new Error('Platform not supported: ' + process.platform);
|
|
|
|
}
|
|
|
|
if (!(process.arch in commandNames[process.platform])) {
|
|
|
|
throw new Error(
|
|
|
|
'Architecture not supported: ' + process.platform + '/' + process.arch);
|
|
|
|
}
|
|
|
|
var commandName = commandNames[process.platform][process.arch];
|
|
|
|
var binaryPath = path.resolve(__dirname, 'bin', commandName);
|
CI overhaul based on GitHub Actions
This replaces Travis (for Linux & Mac) and Appveyor (for Windows) with
GitHub Actions. In addition to using GitHub Actions to test PRs, this
also expands the automation of releases so that the only manual steps
are:
1. Create a new CHANGELOG.md entry
2. Create a release tag
Workflows have been create for building and testing PRs and releases,
for publishing releases to GitHub, NPM, and Docker Hub, and for
updating documentation on GitHub Pages.
When a new PR is created, GitHub Actions will:
- Build and test on all combinations of OS, release type, and library
type
Appveyor's workflow took ~2 hours, whereas the new GitHub Actions
workflow takes ~30 minutes.
When a new release tag is created, GitHub Actions will:
- Create a draft release on GitHub
- Extract release notes from CHANGELOG.md & attach them to the
draft release
- Build and test on all combinations of OS, release type, and library
type, aborting if any build or test fails
- Attach release artifacts to the draft release, aborting if any
one artifact can't be prepared
- Fully publish the draft release on GitHub
- Publish the same release to NPM (triggered by GitHub release)
- Publish the same release to Docker Hub (triggered by GitHub release)
- Update the docs on GitHub pages
Closes #336 (GitHub Actions workflow to replace Travis and Appveyor)
b/190743862 (internal; tracking replacement of Travis)
Change-Id: Ic53eef60a8587c5d1487769a0cefaa16eb9b46e7
2021-06-10 21:40:14 +00:00
|
|
|
|
|
|
|
// Find the args to pass to that binary:
|
|
|
|
// argv[0] is node itself, and argv[1] is the script.
|
|
|
|
// The rest of the args start at 2.
|
|
|
|
var args = process.argv.slice(2);
|
|
|
|
|
|
|
|
var options = {
|
|
|
|
detached: false, // Do not let the child process continue without us
|
|
|
|
stdio: 'inherit', // Pass stdin/stdout/stderr straight through
|
|
|
|
};
|
|
|
|
|
|
|
|
// Execute synchronously:
|
|
|
|
var returnValue = spawnSync(binaryPath, args, options);
|
|
|
|
|
|
|
|
// Pipe the exit code back to the OS:
|
|
|
|
var exitCode = returnValue.error ? returnValue.error.code : 0;
|
|
|
|
process.exit(exitCode);
|