Compare commits

..

22 Commits
v0.4.5 ... r0

Author SHA1 Message Date
umarcor
b346408fef v0.4.7 2024-05-15 17:10:26 +02:00
umarcor
9230b4c574 v0.4.7 2024-05-15 17:09:46 +02:00
umarcor
0c1e72cfd6 with-post-step: use Node.js 20 instead of Node.js 16 2024-05-15 17:03:49 +02:00
umarcor
f11c335674 v0.4.6 2023-02-26 17:46:26 +01:00
umarcor
adef08d3bd v0.4.6 2023-02-26 17:44:46 +01:00
umarcor
191a6471ed releaser: fix creating a release with no assets 2023-02-26 15:42:43 +01:00
Patrick Lehmann
3ae8451cc0 Merge pull request #61 from antoineco/fix-eol
Append EOL after value in GITHUB_STATE
2023-01-27 20:05:35 +01:00
Antoine Cotten
f4951ec52e fix: append EOL after value in GITHUB_STATE 2023-01-27 18:49:49 +01:00
umarcor
5bed864443 v0.4.5 2022-11-08 03:26:27 +01:00
Unai Martinez-Corral
37ec436eb4 v0.4.4 2022-11-08 00:06:47 +00:00
umarcor
6a7a4212c3 v0.4.3 2022-03-02 23:51:16 +01:00
umarcor
f5b6f17d4e v0.4.2 2022-02-22 21:48:31 +01:00
umarcor
883238547a v0.4.1 2022-01-17 01:30:55 +01:00
umarcor
7cd852db58 v0.4.0 2022-01-09 20:58:38 +01:00
umarcor
ce0d30fe3f v0.3.0 2021-12-26 01:45:35 +01:00
umarcor
34dacf7bcf v0.2.3 2021-12-21 01:03:20 +01:00
umarcor
48090e113d v0.2.2 2021-12-20 20:47:43 +01:00
umarcor
e082d77e7a v0.2.1 2021-12-16 07:40:36 +01:00
umarcor
181035b0ba v0.2.0 2021-12-16 07:18:39 +01:00
Patrick Lehmann
643f95bbb6 v0.1.0 2021-12-07 20:50:03 +01:00
umarcor
424b75ca96 v0.0.1 2021-12-07 03:39:33 +01:00
umarcor
f0610331b9 v0.0.0 2021-12-01 00:03:09 +01:00
3 changed files with 17 additions and 13 deletions

View File

@@ -52,7 +52,7 @@ def GetListOfArtifacts(argv, files):
if len(argv) > 1: if len(argv) > 1:
args += argv[1:] args += argv[1:]
if len(args) == 1 and args[0].lower() == "none": 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 [] return []
elif len(args) == 0: elif len(args) == 0:
stdout.flush() stdout.flush()
@@ -63,7 +63,7 @@ def GetListOfArtifacts(argv, files):
print(f" glob({item!s}):") print(f" glob({item!s}):")
for fname in [fname for fname in glob(item, recursive=True) if not Path(fname).is_dir()]: for fname in [fname for fname in glob(item, recursive=True) if not Path(fname).is_dir()]:
if Path(fname).stat().st_size == 0: if Path(fname).stat().st_size == 0:
print(f" - ! Skipping empty file {fname!s}") print(f" - ! Skipping empty file {fname!s}.")
continue continue
print(f" - {fname!s}") print(f" - {fname!s}")
flist.append(fname) flist.append(fname)
@@ -101,7 +101,7 @@ def CheckRefSemVer(gh_ref, tag, snapshots):
return (tag, env_tag, False) return (tag, env_tag, False)
elif snapshots: elif snapshots:
# is semver compilant prerelease tag, thus a snapshot (we skip it) # is semver compilant prerelease tag, thus a snapshot (we skip it)
print("! Skipping snapshot prerelease") print("! Skipping snapshot prerelease.")
sys_exit() sys_exit()
return (tag, env_tag, True) return (tag, env_tag, True)
@@ -179,12 +179,15 @@ if paramRM:
asset.delete_asset() asset.delete_asset()
stdout.flush() stdout.flush()
print("· Cleanup and/or upload artifacts") if len(files) > 0:
env = environ.copy() print("· Upload assets")
env["GITHUB_TOKEN"] = paramToken env = environ.copy()
cmd = ["gh", "release", "upload", "--repo", paramRepo, "--clobber", tag] + files env["GITHUB_TOKEN"] = paramToken
print(f" > {' '.join(cmd)}") cmd = ["gh", "release", "upload", "--repo", paramRepo, "--clobber", tag] + files
check_call(cmd, env=env) print(f" > {' '.join(cmd)}")
stdout.flush() 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) UpdateReference(gh_release, tag, paramSHA if env_tag is None else None, is_prerelease, is_draft)

View File

@@ -37,6 +37,6 @@ inputs:
default: POST default: POST
runs: runs:
using: 'node16' using: 'node20'
main: 'main.js' main: 'main.js'
post: 'main.js' post: 'main.js'

View File

@@ -26,7 +26,8 @@
* * https://github.com/actions/runner/issues/1478 * * * https://github.com/actions/runner/issues/1478 *
* ================================================================================================================== */ * ================================================================================================================== */
const { spawn } = require("child_process"); const { spawn } = require("child_process");
const fs = require('fs'); const { appendFileSync } = require("fs");
const { EOL } = require("os");
function run(cmd) { function run(cmd) {
const subprocess = spawn(cmd, { stdio: "inherit", shell: true }); const subprocess = spawn(cmd, { stdio: "inherit", shell: true });
@@ -40,6 +41,6 @@ const key = process.env.INPUT_KEY.toUpperCase();
if ( process.env[`STATE_${key}`] !== undefined ) { // Are we in the 'post' step? if ( process.env[`STATE_${key}`] !== undefined ) { // Are we in the 'post' step?
run(process.env.INPUT_POST); run(process.env.INPUT_POST);
} else { // Otherwise, this is the main step } 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); run(process.env.INPUT_MAIN);
} }