Skip to content

Commit

Permalink
Modernize the code
Browse files Browse the repository at this point in the history
Add build workflow

Split code into smaller functions

Revert "Split code into smaller functions"

This reverts commit d2b9240.

Fix imports

Use raw nodejs

Remove node: prefix from imports

Split processing into two promises and use @actions/glob

Add missing module

Add failure when no artifacts are matched

Tidy up log messages

Rename function for cleaner meaning

Use for-await expression

Use glob v11

Roll back glob since it does not support ignore patterns as easily as @actions/glob

Update README

Rollback action.yml changes for contribution

Update README re. nvm

Rollback action name

Signed-off-by: Artem Shubovych <shybovycha@gmail.com>
  • Loading branch information
shybovycha committed Jul 22, 2024
1 parent 13926a6 commit 03c14b4
Show file tree
Hide file tree
Showing 9 changed files with 4,635 additions and 5,584 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build

on:
pull_request:
branches:
- main

push:
branches:
- main

release:
types: [created]

permissions:
contents: read

jobs:
build:
name: Build action
runs-on: ubuntu-latest

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.15.1
4 changes: 0 additions & 4 deletions Makefile

This file was deleted.

11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ GitHub Action to upload multiple assets to a release
This action aims to resolve several outstanding user requests with [@actions/upload-release-asset](https://github.com/actions/upload-release-asset).

* Getting the latest release tag for upload
* Globbing i.e. `./bin/*`
* Succinct - no need to populate content_type and a separate path input
* [Glob patterns](https://github.com/actions/toolkit/tree/main/packages/glob#patterns) i.e. `./bin/*`, `!/bin/**/*.tmp`
* Succinct - no need to populate `content_type` and a separate path input

## Check out my eBooks 📖 🤓

Expand Down Expand Up @@ -74,24 +74,23 @@ Example taken from [this sample project](https://github.com/alexellis/release-it

## Creating a new version

Getting started:
Getting started - use the right NodeJS version with [`nvm`](https://github.com/nvm-sh/nvm):

```bash
npm i -g @vercel/ncc
nvm install
```

Build:

```bash
npm i
npm install
npm run build
```

## License

MIT


## Contribution guide

1) Any contributions must be proposed via a GitHub issue for discussion before being worked on.
Expand Down
Loading

0 comments on commit 03c14b4

Please sign in to comment.