Skip to content

Commit

Permalink
allow pkg action to use ANY pkg package eg @yao-pkg/pkg@5.10.0 (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog authored Dec 4, 2023
1 parent aa1c8a4 commit ffb174b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/pr-func-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ jobs:
- linux
- macos
- win
pkg-version:
- "5.8.0"
- "5.8.1"
pkg:
- "pkg@5.8.0"
- "pkg@5.8.1"
- "@yao-pkg/pkg@5.10.0"
steps:
- name: Checkout action code
uses: actions/checkout@v3
Expand All @@ -62,5 +63,5 @@ jobs:
entrypoint: bin/test
node-version: ${{ matrix.node-version }}
os: ${{ matrix.os }}
pkg: ${{ matrix.pkg-version }}
pkg: ${{ matrix.pkg }}
upload: false
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
- name: Prepare release
uses: lando/prepare-release-action@v2
with:
sync-tags: v3
sync-tags: v4
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v4.0.0 - [December 4, 2023](https://github.com/lando/pkg-action/releases/tag/v4.0.0)

### **BREAKING CHANGES**

* `pkg` input now takes any valid spec eg `@yao-pkg/pkg@5.10.0` as opposed to just the `versions`

## v3.0.1 - [September 28, 2023](https://github.com/lando/pkg-action/releases/tag/v3.0.1)

* Reverted `node-sync` do to extreme slowness using `node16` in `arm64` environment
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ These keys are set to sane defaults but can be modified as needed.
| `node-version` | The node version to package with. | `16` | `8` \| `10` \| `12` \| `14` \| `16` |
| `options` | Additional options and flags to pass into pkg. | `null` | Additional [pkg options](https://github.com/vercel/pkg#usage) |
| `os` | The operating system to build for. | `${{ runner.os }}` | `linux` \| `macos` \| `win` |
| `pkg` | The version on @vercel/pkg to use. | `5.8.1` | `latest` |
| `pkg` | The `pkg` package` to use. | `pkg@5.8.1` | `latest` |
| `upload` | Upload the artifacts. Useful if you need to grab them for downstream for things like code signing. | `true` | `false` \| `true` |

## Outputs
Expand All @@ -55,7 +55,7 @@ outputs:
```yaml
name: Package into node binary
uses: lando/pkg-action@v3
uses: lando/pkg-action@v4
with:
entrypoint: bin/cli
```
Expand All @@ -65,7 +65,7 @@ with:
**ALL OPTIONS**
```yaml
name: Package into node binary
uses: lando/pkg-action@v3
uses: lando/pkg-action@v4
with:
entrypoint: bin/cli
arch: arm64
Expand All @@ -74,6 +74,7 @@ with:
options: -C
os: win
upload: false
pkg: "@yao-pkg/pkg@5.10.0"
```
**CROSS COMPILE ON ALL THE THINGS**
Expand Down
8 changes: 4 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ inputs:
pkg:
description: "The version on @vercel/pkg to use"
required: false
default: "5.8.1"
default: "pkg@5.8.1"
test:
description: "Hidden flag for input testing"
default: false
Expand Down Expand Up @@ -95,10 +95,10 @@ runs:
node-version: ${{ inputs.node-version }}
cache: npm

- name: Install pkg ${{ inputs.pkg }}
- name: Install ${{ inputs.pkg }}
shell: bash
run: |
npm install -g pkg@${{ inputs.pkg }}
npm install -g ${{ inputs.pkg }}
if pkg --version >/dev/null; then
echo "::notice title=pkg installed::Using version $(pkg --version)"
else
Expand Down Expand Up @@ -160,7 +160,7 @@ runs:
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt update && apt -y install yarn
yarn global add pkg@${{ inputs.pkg }} --prefix /usr/local
yarn global add ${{ inputs.pkg }} --prefix /usr/local
pkg --version
run: |
pkg \
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"Github Actions"
],
"engines": {
"node": ">=16.0.0"
"node": ">=18.0.0"
}
}

0 comments on commit ffb174b

Please sign in to comment.