Skip to content

Commit f7c7ce3

Browse files
committed
updated to node 20
removed file being required
1 parent 91b1968 commit f7c7ce3

File tree

7 files changed

+71
-48
lines changed

7 files changed

+71
-48
lines changed

.github/workflows/main.yml

+29-21
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@ env:
77
on:
88
push:
99
branches:
10-
master
10+
main
1111

1212
jobs:
13+
create:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Create release
19+
uses: altavec/update-existing-release@v1
1320
ci:
1421
name: Continuous integration
1522
runs-on: ${{ matrix.os }}
@@ -20,23 +27,24 @@ jobs:
2027
- ubuntu-latest
2128
- windows-latest
2229
- macOS-latest
23-
steps:
24-
- name: Install gnuwin32 and zip on Windows
25-
if: startsWith(matrix.os, 'windows')
26-
run: choco install gnuwin32-coreutils.install zip
27-
- name: Check out sources
28-
uses: actions/checkout@v2
29-
- name: Build bundle with npm
30-
run: |
31-
npm install
32-
npm run bundle
33-
- name: Zip distribution
34-
run: |
35-
zip -9 update-existing-release-${{ matrix.os }}.zip *
36-
zip -9 -r update-existing-release-${{ matrix.os }}.zip src dist img .github
37-
- name: Update release
38-
uses: ColinPitrat/update-existing-release@master
39-
id: update-existing-release
40-
with:
41-
token: ${{ secrets.GITHUB_TOKEN }}
42-
files: update-existing-release-${{ matrix.os }}.zip
30+
steps:
31+
- name: Install gnuwin32 and zip on Windows
32+
if: startsWith(matrix.os, 'windows')
33+
run: choco install gnuwin32-coreutils.install zip
34+
35+
- uses: actions/checkout@v4
36+
37+
- name: Build bundle with npm
38+
run: |
39+
npm install
40+
npm run bundle
41+
42+
- name: Zip distribution
43+
run: |
44+
zip -9 update-existing-release-${{ matrix.os }}.zip *
45+
zip -9 -r update-existing-release-${{ matrix.os }}.zip src dist img .github
46+
47+
- name: Update release
48+
uses: altavec/update-existing-release@v1
49+
with:
50+
files: update-existing-release-${{ matrix.os }}.zip

README.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Create, update, and edit existing releases!
55
Great for creating a `latest` or `nightly` release.
66

77
```yaml
8-
- uses: IsaacShelton/update-existing-release@v1.3.4
8+
- uses: altavec/update-existing-release@v1
99
with:
1010
token: ${{secrets.GITHUB_TOKEN}}
1111
release: "Nightly"
@@ -22,7 +22,7 @@ Great for creating a `latest` or `nightly` release.
2222
2323
This action is the successor to the `update-release` GitHub action. It has been updated to work with the latest GitHub APIs and also includes bugs fixes and additional features.
2424

25-
[`IsaacShelton/update-existing-release`](https://github.com/IsaacShelton/update-existing-release) <- [`ColinPitrat/update-release`](https://github.com/ColinPitrat/update-release) <- [`johnwbyrd/update-release`](https://github.com/johnwbyrd/update-release)
25+
[`altavec/update-existing-release`](https://github.com/altavec/update-existing-release) <- `IsaacShelton/update-existing-release`](https://github.com/IsaacShelton/update-existing-release) <- [`ColinPitrat/update-release`](https://github.com/ColinPitrat/update-release) <- [`johnwbyrd/update-release`](https://github.com/johnwbyrd/update-release)
2626

2727

2828
### Inputs
@@ -31,7 +31,7 @@ This action has the following inputs:
3131
| Input | Description |
3232
| ------------ | ----------------------------------------------------------------------- |
3333
| `token` **(required)** | This should be [your secure Github token](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token). Use `${{ secrets.GITHUB_TOKEN }}` if your build lasts less than an hour. Otherwise, you will need to [create your own access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) with repo admin access, [store it as a secret](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets) in your own repository, and reference that secret token in your build. |
34-
| `files` **(required)** | The files that you want for your the release. Presumably, this should include at least one file that you just built. File paths can be provided as absolute paths, or they can be relative to `${{ github.workspace }}`. |
34+
| `files` | The files that you want for your the release. Presumably, this should include at least one file that you just built. File paths can be provided as absolute paths, or they can be relative to `${{ github.workspace }}`. |
3535
| `release` | The name of the release to be created. If none is supplied, a reasonable looking one will be chosen based on `${{ github.ref }}`. |
3636
| `tag` | The name of the tag to be created. For some inexplicable reason, Github thinks that you need to have a tag corresponding to every release, which makes no sense if you're using Github to do continuous integration builds. The tag will be the same as the calculated name of the release, if this input is not supplied. |
3737
| `message` | A brief description of the tag and also of the release. |
@@ -59,7 +59,7 @@ If successful, this action will have the following outputs:
5959
The `${{ secrets.GITHUB_TOKEN }}` is valid for exactly an hour from the time your build starts. If your build requires longer than an hour to run, you will need to [create your own access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) with repo admin access, [store it as a secret](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets) in your own repository, and reference that secret token in your build:
6060

6161
```yaml
62-
- uses: IsaacShelton/update-existing-release@v1.3.4
62+
- uses: altavec/update-existing-release@v1
6363
with:
6464
token: ${{ secrets.YOUR_PRIVATE_SECRET_TOKEN }}
6565
release: Nightly
@@ -83,6 +83,11 @@ The `${{ secrets.GITHUB_TOKEN }}` is valid for exactly an hour from the time you
8383

8484
### Changelog
8585

86+
**`v1.3.5`**
87+
88+
- Updated to node20
89+
- Remove that files are required
90+
8691
**`v1.3.4`**
8792

8893
- Updated dependencies

action.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ author: 'Isaac Shelton'
44
inputs:
55
token:
66
description: 'Your Github token; try \$\{\{ secrets.GITHUB_TOKEN \}\} if your build lasts less than an hour, or create your own secret token with repository access if your build requires longer than an hour.'
7-
required: true
7+
required: false
8+
default: ${{ github.token }}
89
files:
910
description: 'Paths to built files to be released. May be absolute or relative to \$\{\{ github.workspace \}\}.'
10-
required: true
11+
required: false
1112
release:
1213
description: 'The name of the release to be created. A reasonable looking release name will be created from the current \$\{\{ github.ref \}\} if this input is not supplied.'
1314
required: false
@@ -44,7 +45,7 @@ outputs:
4445
tag:
4546
description: 'The calculated tag for the release.'
4647
runs:
47-
using: 'node16'
48+
using: 'node20'
4849
main: 'dist/main.js'
4950
branding:
5051
icon: wind

dist/main.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "update-existing-release",
3-
"version": "1.3.4",
3+
"version": "1.3.5",
44
"description": "A smarter way to make fresh build assets continuously available and edit releases, with Github actions",
55
"main": "./dist/main.js",
66
"scripts": {
@@ -19,7 +19,7 @@
1919
"build",
2020
"actions"
2121
],
22-
"author": "Isaac Shelton",
22+
"author": "altavec",
2323
"license": "ISC",
2424
"devDependencies": {
2525
"@typescript-eslint/eslint-plugin": "^2.17.0",

src/main.ts

+24-15
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ class Connection {
251251
protected async useExistingRelease() {
252252
core.startGroup('Finding ID of release...')
253253

254-
if(this.id >= 0){
254+
if (this.id >= 0) {
255255
this.dump('Using cached', this.id);
256256
core.endGroup();
257257
return;
@@ -369,24 +369,29 @@ class Connection {
369369
}
370370

371371
protected setFiles() {
372-
let inputFileString: string = core.getInput('files', { required: true });
373-
let inputFiles: Array<string> = inputFileString.split(/[ ,\r\n\t]+/);
374-
for (let oneFile of inputFiles) {
375-
let tryPath: string = oneFile;
376-
if (!existsSync(tryPath) || !isAbsolute(tryPath)) {
377-
// go on a path hunt
378-
tryPath = resolve(process.env.GITHUB_WORKSPACE, oneFile);
372+
let inputFileString: string = core.getInput('files');
373+
if (inputFileString && inputFileString.length > 0) {
374+
let inputFiles: Array<string> = inputFileString.split(/[ ,\r\n\t]+/);
375+
for (let oneFile of inputFiles) {
376+
let tryPath: string = oneFile;
377+
if (!existsSync(tryPath) || !isAbsolute(tryPath)) {
378+
// go on a path hunt
379+
tryPath = resolve(process.env.GITHUB_WORKSPACE, oneFile);
380+
if (!existsSync(tryPath)) {
381+
throw new Error(`could not find ${oneFile} as either absolute path or path relative to workspace`);
382+
}
383+
}
384+
379385
if (!existsSync(tryPath)) {
380-
throw new Error(`could not find ${oneFile} as either absolute path or path relative to workspace`);
386+
throw new Error(`could not find file ${tryPath} for release; please provide a full path or path relative to workspace`);
381387
}
388+
389+
// Although Windows uses backslashes as separators, Windows can also use forward slashes as separators
390+
// and this choice is more compatible with cross-platform scripts
391+
this.files.push(tryPath.replace(/\\/g, '/'));
382392
}
383-
if (!existsSync(tryPath)) {
384-
throw new Error(`could not find file ${tryPath} for release; please provide a full path or path relative to workspace`);
385-
}
386-
// Although Windows uses backslashes as separators, Windows can also use forward slashes as separators
387-
// and this choice is more compatible with cross-platform scripts
388-
this.files.push(tryPath.replace(/\\/g, '/'));
389393
}
394+
390395
core.setOutput('files', JSON.stringify(this.files));
391396
}
392397

@@ -435,6 +440,10 @@ class Connection {
435440
}
436441

437442
protected async uploadAssets() {
443+
if (this.files.length == 0) {
444+
return;
445+
}
446+
438447
// if we can't figure out what file type you have, we'll assign it this unknown type
439448
// https://www.iana.org/assignments/media-types/application/octet-stream
440449
const defaultAssetContentType = 'application/octet-stream';

0 commit comments

Comments
 (0)