mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-14 12:06:56 +08:00
Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b346408fef | ||
|
|
9230b4c574 | ||
|
|
0c1e72cfd6 | ||
|
|
f11c335674 | ||
|
|
adef08d3bd | ||
|
|
191a6471ed | ||
|
|
3ae8451cc0 | ||
|
|
f4951ec52e | ||
|
|
5bed864443 | ||
|
|
cc576ce25a | ||
|
|
decf16ff8f | ||
|
|
9faa1459c9 | ||
|
|
37ec436eb4 | ||
|
|
6a7a4212c3 | ||
|
|
f5b6f17d4e | ||
|
|
883238547a | ||
|
|
7cd852db58 | ||
|
|
ce0d30fe3f | ||
|
|
34dacf7bcf | ||
|
|
48090e113d | ||
|
|
e082d77e7a | ||
|
|
181035b0ba | ||
|
|
643f95bbb6 | ||
|
|
424b75ca96 | ||
|
|
f0610331b9 |
@@ -52,7 +52,7 @@ def GetListOfArtifacts(argv, files):
|
||||
if len(argv) > 1:
|
||||
args += argv[1:]
|
||||
if len(args) == 1 and args[0].lower() == "none":
|
||||
print("! Skipping 'files' because it's set to 'none")
|
||||
print("! Skipping 'files' because it's set to 'none'.")
|
||||
return []
|
||||
elif len(args) == 0:
|
||||
stdout.flush()
|
||||
@@ -63,7 +63,7 @@ def GetListOfArtifacts(argv, files):
|
||||
print(f" glob({item!s}):")
|
||||
for fname in [fname for fname in glob(item, recursive=True) if not Path(fname).is_dir()]:
|
||||
if Path(fname).stat().st_size == 0:
|
||||
print(f" - ! Skipping empty file {fname!s}")
|
||||
print(f" - ! Skipping empty file {fname!s}.")
|
||||
continue
|
||||
print(f" - {fname!s}")
|
||||
flist.append(fname)
|
||||
@@ -101,7 +101,7 @@ def CheckRefSemVer(gh_ref, tag, snapshots):
|
||||
return (tag, env_tag, False)
|
||||
elif snapshots:
|
||||
# is semver compilant prerelease tag, thus a snapshot (we skip it)
|
||||
print("! Skipping snapshot prerelease")
|
||||
print("! Skipping snapshot prerelease.")
|
||||
sys_exit()
|
||||
|
||||
return (tag, env_tag, True)
|
||||
@@ -179,12 +179,15 @@ if paramRM:
|
||||
asset.delete_asset()
|
||||
stdout.flush()
|
||||
|
||||
print("· Cleanup and/or upload artifacts")
|
||||
env = environ.copy()
|
||||
env["GITHUB_TOKEN"] = paramToken
|
||||
cmd = ["gh", "release", "upload", "--repo", paramRepo, "--clobber", tag] + files
|
||||
print(f" > {' '.join(cmd)}")
|
||||
check_call(cmd, env=env)
|
||||
stdout.flush()
|
||||
if len(files) > 0:
|
||||
print("· Upload assets")
|
||||
env = environ.copy()
|
||||
env["GITHUB_TOKEN"] = paramToken
|
||||
cmd = ["gh", "release", "upload", "--repo", paramRepo, "--clobber", tag] + files
|
||||
print(f" > {' '.join(cmd)}")
|
||||
check_call(cmd, env=env)
|
||||
stdout.flush()
|
||||
else:
|
||||
print("! Skipping uploading assets because the file list is empty.")
|
||||
|
||||
UpdateReference(gh_release, tag, paramSHA if env_tag is None else None, is_prerelease, is_draft)
|
||||
|
||||
@@ -37,6 +37,6 @@ inputs:
|
||||
default: POST
|
||||
|
||||
runs:
|
||||
using: 'node16'
|
||||
using: 'node20'
|
||||
main: 'main.js'
|
||||
post: 'main.js'
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
* Unai Martinez-Corral *
|
||||
* *
|
||||
* ================================================================================================================== *
|
||||
* Copyright 2021 Unai Martinez-Corral <unai.martinezcorral@ehu.eus> *
|
||||
* Copyright 2021-2022 Unai Martinez-Corral <unai.martinezcorral@ehu.eus> *
|
||||
* Copyright 2022 Unai Martinez-Corral <umartinezcorral@antmicro.com> *
|
||||
* *
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); *
|
||||
* you may not use this file except in compliance with the License. *
|
||||
@@ -25,13 +26,11 @@
|
||||
* * https://github.com/actions/runner/issues/1478 *
|
||||
* ================================================================================================================== */
|
||||
const { spawn } = require("child_process");
|
||||
const fs = require('fs');
|
||||
const { appendFileSync } = require("fs");
|
||||
const { EOL } = require("os");
|
||||
|
||||
function run(cmdline) {
|
||||
var args = cmdline.split(" ");
|
||||
const cmd = args.shift();
|
||||
|
||||
const subprocess = spawn(cmd, args, { stdio: "inherit" });
|
||||
function run(cmd) {
|
||||
const subprocess = spawn(cmd, { stdio: "inherit", shell: true });
|
||||
subprocess.on("exit", (exitCode) => {
|
||||
process.exitCode = exitCode;
|
||||
});
|
||||
@@ -42,6 +41,6 @@ const key = process.env.INPUT_KEY.toUpperCase();
|
||||
if ( process.env[`STATE_${key}`] !== undefined ) { // Are we in the 'post' step?
|
||||
run(process.env.INPUT_POST);
|
||||
} else { // Otherwise, this is the main step
|
||||
fs.appendFileSync(process.env.GITHUB_STATE, `${key}=true`);
|
||||
appendFileSync(process.env.GITHUB_STATE, `${key}=true${EOL}`);
|
||||
run(process.env.INPUT_MAIN);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user