Update Github Actions CI set-env/add-path (#2265)
In accordance with [this advisory](https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/) it's recommended we moved to a different scheme of setting env vars and updating PATH.
This commit is contained in:
17
.github/actions/binary-compatible-builds/main.js
vendored
17
.github/actions/binary-compatible-builds/main.js
vendored
@@ -2,19 +2,24 @@
|
||||
|
||||
const child_process = require('child_process');
|
||||
const stdio = { stdio: 'inherit' };
|
||||
const fs = require('fs');
|
||||
|
||||
function set_env(name, val) {
|
||||
fs.appendFileSync(process.env['GITHUB_ENV'], `${name}=${val}\n`)
|
||||
}
|
||||
|
||||
// On OSX all we need to do is configure our deployment target as old as
|
||||
// possible. For now 10.9 is the limit.
|
||||
if (process.platform == 'darwin') {
|
||||
console.log("::set-env name=MACOSX_DEPLOYMENT_TARGET::10.9");
|
||||
console.log("::set-env name=python::python3");
|
||||
set_env("MACOSX_DEPLOYMENT_TARGET", "10.9");
|
||||
set_env("python", "python3");
|
||||
return;
|
||||
}
|
||||
|
||||
// On Windows we build against the static CRT to reduce dll dependencies
|
||||
if (process.platform == 'win32') {
|
||||
console.log("::set-env name=RUSTFLAGS::-Ctarget-feature=+crt-static");
|
||||
console.log("::set-env name=python::python");
|
||||
set_env("RUSTFLAGS", "-Ctarget-feature=+crt-static");
|
||||
set_env("python", "python");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -51,7 +56,7 @@ child_process.execFileSync('docker', [
|
||||
], stdio);
|
||||
|
||||
// Use ourselves to run future commands
|
||||
console.log(`::set-env name=CENTOS::${__filename}`)
|
||||
set_env("CENTOS", __filename);
|
||||
|
||||
// See https://edwards.sdsu.edu/research/c11-on-centos-6/ for where these
|
||||
const exec = s => {
|
||||
@@ -66,4 +71,4 @@ exec('yum install -y git');
|
||||
// This is a hack and not the right way to do this, but it ends up doing the
|
||||
// right thing for now.
|
||||
exec('rm -f /opt/rh/devtoolset-8/root/usr/lib/gcc/x86_64-redhat-linux/8/libstdc++.so');
|
||||
console.log("::set-env name=python::python3");
|
||||
set_env("python", "python3");
|
||||
|
||||
Reference in New Issue
Block a user