Compare commits

..

No commits in common. "master" and "v1.3.2" have entirely different histories.

49 changed files with 10813 additions and 7891 deletions

View File

@ -1,12 +0,0 @@
/coverage
# Dependency directories
node_modules/
jspm_packages/
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

View File

@ -1,3 +0,0 @@
/dist/**
/coverage/**
/node_modules/**

View File

@ -1,24 +0,0 @@
{
"env": {
"node": true,
"es6": true,
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"jest",
"prettier"
]
}

2
.gitattributes vendored
View File

@ -1,4 +1,2 @@
/.yarn/releases/** binary
/.yarn/plugins/** binary
/dist/** linguist-generated=true
/lib/** linguist-generated=true

View File

@ -2,20 +2,18 @@
Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.
Contributions to this project are [released](https://docs.github.com/en/github/site-policy/github-terms-of-service#6-contributions-under-repository-license)
to the public under the [project's open source license](LICENSE).
Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE).
## Submitting a pull request
1. [Fork](https://github.com/crazy-max/ghaction-upx/fork) and clone the repository
2. Configure and install the dependencies: `yarn install`
3. Create a new branch: `git checkout -b my-branch-name`
4. Make your changes
5. Make sure the tests pass: `docker buildx bake test`
6. Format code and build javascript artifacts: `docker buildx bake pre-checkin`
7. Validate all code has correctly formatted and built: `docker buildx bake validate`
8. Push to your fork and [submit a pull request](https://github.com/crazy-max/ghaction-upx/compare)
9. Pat your self on the back and wait for your pull request to be reviewed and merged.
2. Configure and install the dependencies: `npm install`
3. Make sure the tests pass on your machine: `npm run test`
4. Create a new branch: `git checkout -b my-branch-name`
5. Make your change, add tests, and make sure the tests still pass
6. Run pre-checkin: `npm run pre-checkin`
7. Push to your fork and [submit a pull request](https://github.com/crazy-max/ghaction-upx/compare)
8. Pat your self on the back and wait for your pull request to be reviewed and merged.
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
@ -28,5 +26,5 @@ Here are a few things you can do that will increase the likelihood of your pull
## Resources
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
- [Using Pull Requests](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests)
- [GitHub Help](https://docs.github.com/en)
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/)
- [GitHub Help](https://help.github.com)

View File

@ -1,101 +0,0 @@
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
name: Bug Report
description: Report a bug
labels:
- kind/bug
- status/triage
body:
- type: checkboxes
attributes:
label: Support guidelines
description: Please read the support guidelines before proceeding.
options:
- label: I've read the [support guidelines](https://github.com/crazy-max/ghaction-upx/blob/master/.github/SUPPORT.md)
required: true
- type: checkboxes
attributes:
label: I've found a bug and checked that ...
description: |
Make sure that your request fulfills all of the following requirements. If one requirement cannot be satisfied, explain in detail why.
options:
- label: ... the documentation does not mention anything about my problem
- label: ... there are no open or closed issues that are related to my problem
- type: textarea
attributes:
label: Description
description: |
Please provide a brief description of the bug in 1-2 sentences.
validations:
required: true
- type: textarea
attributes:
label: Expected behaviour
description: |
Please describe precisely what you'd expect to happen.
validations:
required: true
- type: textarea
attributes:
label: Actual behaviour
description: |
Please describe precisely what is actually happening.
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce
description: |
Please describe the steps to reproduce the bug.
placeholder: |
1. ...
2. ...
3. ...
validations:
required: true
- type: input
attributes:
label: Repository URL
description: >
Enter the URL of the repository where you are experiencing the
issue. If your repository is private, provide a link to a minimal
repository that reproduces the issue.
validations:
required: true
- type: input
attributes:
label: Workflow run URL
description: >
Enter the URL of the GitHub Action workflow run that fails (e.g.
`https://github.com/<user>/<repo>/actions/runs/<id>`)
- type: textarea
attributes:
label: YAML workflow
description: |
Provide the YAML of the workflow that's causing the issue.
Make sure to remove any sensitive information.
render: yaml
validations:
required: true
- type: textarea
attributes:
label: Workflow logs
description: >
[Attach](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/attaching-files)
the [log file of your workflow run](https://docs.github.com/en/actions/managing-workflow-runs/using-workflow-run-logs#downloading-logs)
and make sure to remove any sensitive information.
- type: textarea
attributes:
label: Additional info
description: |
Please provide any additional information that seem useful.

33
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
---
### Behaviour
#### Steps to reproduce this issue
1.
2.
3.
#### Expected behaviour
> Tell me what should happen
#### Actual behaviour
> Tell me what happens instead
### Configuration
* Repository URL (if public):
* Build URL (if public):
```yml
# paste your YAML workflow file here and remove sensitive data
```
### Logs
> Download the [log file of your build](https://help.github.com/en/actions/configuring-and-managing-workflows/managing-a-workflow-run#downloading-logs) and [attach it](https://help.github.com/en/github/managing-your-work-on-github/file-attachments-on-issues-and-pull-requests) to this issue.

View File

@ -1,6 +0,0 @@
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
blank_issues_enabled: true
contact_links:
- name: Questions and Discussions
url: https://github.com/crazy-max/ghaction-upx/discussions/new
about: Use Github Discussions to ask questions and/or open discussion topics.

View File

@ -1,15 +0,0 @@
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
name: Feature request
description: Missing functionality? Come tell us about it!
labels:
- kind/enhancement
- status/triage
body:
- type: textarea
id: description
attributes:
label: Description
description: What is the feature you want to see?
validations:
required: true

View File

@ -1,19 +1,11 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "kind/dependencies"
- "bot"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
versioning-strategy: "increase"
allow:
- dependency-type: "production"
time: "06:00"
timezone: "Europe/Paris"
labels:
- "kind/dependencies"
- "bot"
- ":game_die: dependencies"
- ":robot: bot"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

102
.github/labels.yml vendored
View File

@ -1,69 +1,73 @@
## more info https://github.com/crazy-max/ghaction-github-labeler
-
name: "bot"
- # bot
name: ":robot: bot"
color: "69cde9"
description: ""
-
name: "good first issue"
color: "7057ff"
description: ""
-
name: "help wanted"
color: "4caf50"
description: ""
-
name: "area/ci"
color: "ed9ca9"
description: ""
-
name: "kind/bug"
- # bug
name: ":bug: bug"
color: "b60205"
description: ""
-
name: "kind/dependencies"
- # dependencies
name: ":game_die: dependencies"
color: "0366d6"
description: ""
-
name: "kind/docs"
- # documentation
name: ":memo: documentation"
color: "c5def5"
description: ""
-
name: "kind/duplicate"
- # duplicate
name: ":busts_in_silhouette: duplicate"
color: "cccccc"
description: ""
-
name: "kind/enhancement"
- # enhancement
name: ":sparkles: enhancement"
color: "0054ca"
description: ""
-
name: "kind/invalid"
- # feature request
name: ":bulb: feature request"
color: "0e8a16"
description: ""
- # feedback
name: ":mega: feedback"
color: "03a9f4"
description: ""
- # future maybe
name: ":rocket: future maybe"
color: "fef2c0"
description: ""
- # good first issue
name: ":hatching_chick: good first issue"
color: "7057ff"
description: ""
- # help wanted
name: ":pray: help wanted"
color: "4caf50"
description: ""
- # hold
name: ":hand: hold"
color: "24292f"
description: ""
- # invalid
name: ":no_entry_sign: invalid"
color: "e6e6e6"
description: ""
-
name: "kind/upstream"
color: "fbca04"
- # maybe bug
name: ":interrobang: maybe bug"
color: "ff5722"
description: ""
-
name: "kind/wontfix"
color: "ffffff"
description: ""
-
name: "status/automerge"
color: "8f4fbc"
description: ""
-
name: "status/needs-investigation"
color: "e6625b"
description: ""
-
name: "status/needs-more-info"
- # needs more info
name: ":thinking: needs more info"
color: "795548"
description: ""
-
name: "status/stale"
color: "237da0"
- # question
name: ":question: question"
color: "3f51b5"
description: ""
-
name: "status/triage"
color: "dde4b7"
- # upstream
name: ":eyes: upstream"
color: "fbca04"
description: ""
- # wontfix
name: ":coffin: wontfix"
color: "ffffff"
description: ""

View File

@ -1,364 +0,0 @@
{
"latest": {
"id": 216714091,
"tag_name": "v5.0.1",
"html_url": "https://github.com/upx/upx/releases/tag/v5.0.1",
"assets": [
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-amd64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-arm64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-arm_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-armeb_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-dos.zip",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-i386_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-mips_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-mipsel_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-powerpc64le_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-powerpc_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-src.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-win32.zip",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-win64.zip"
]
},
"v5.0.1": {
"id": 216714091,
"tag_name": "v5.0.1",
"html_url": "https://github.com/upx/upx/releases/tag/v5.0.1",
"assets": [
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-amd64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-arm64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-arm_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-armeb_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-dos.zip",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-i386_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-mips_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-mipsel_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-powerpc64le_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-powerpc_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-src.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-win32.zip",
"https://github.com/upx/upx/releases/download/v5.0.1/upx-5.0.1-win64.zip"
]
},
"v5.0.0": {
"id": 201485424,
"tag_name": "v5.0.0",
"html_url": "https://github.com/upx/upx/releases/tag/v5.0.0",
"assets": [
"https://github.com/upx/upx/releases/download/v5.0.0/upx-5.0.0-amd64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.0/upx-5.0.0-arm64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.0/upx-5.0.0-arm_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.0/upx-5.0.0-armeb_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.0/upx-5.0.0-dos.zip",
"https://github.com/upx/upx/releases/download/v5.0.0/upx-5.0.0-i386_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.0/upx-5.0.0-mips_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.0/upx-5.0.0-mipsel_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.0/upx-5.0.0-powerpc64le_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.0/upx-5.0.0-powerpc_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.0/upx-5.0.0-src.tar.xz",
"https://github.com/upx/upx/releases/download/v5.0.0/upx-5.0.0-win32.zip",
"https://github.com/upx/upx/releases/download/v5.0.0/upx-5.0.0-win64.zip"
]
},
"v4.2.4": {
"id": 154915740,
"tag_name": "v4.2.4",
"html_url": "https://github.com/upx/upx/releases/tag/v4.2.4",
"assets": [
"https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-amd64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-arm64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-arm_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-armeb_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-dos.zip",
"https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-i386_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-mips_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-mipsel_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-powerpc64le_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-powerpc_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-src.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-win32.zip",
"https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-win64.zip"
]
},
"v4.2.3": {
"id": 148738382,
"tag_name": "v4.2.3",
"html_url": "https://github.com/upx/upx/releases/tag/v4.2.3",
"assets": [
"https://github.com/upx/upx/releases/download/v4.2.3/upx-4.2.3-amd64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.3/upx-4.2.3-arm64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.3/upx-4.2.3-arm_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.3/upx-4.2.3-armeb_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.3/upx-4.2.3-dos.zip",
"https://github.com/upx/upx/releases/download/v4.2.3/upx-4.2.3-i386_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.3/upx-4.2.3-mips_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.3/upx-4.2.3-mipsel_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.3/upx-4.2.3-powerpc64le_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.3/upx-4.2.3-powerpc_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.3/upx-4.2.3-src.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.3/upx-4.2.3-win32.zip",
"https://github.com/upx/upx/releases/download/v4.2.3/upx-4.2.3-win64.zip"
]
},
"v4.2.2": {
"id": 135721197,
"tag_name": "v4.2.2",
"html_url": "https://github.com/upx/upx/releases/tag/v4.2.2",
"assets": [
"https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-amd64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-arm64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-arm_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-armeb_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-dos.zip",
"https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-i386_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-mips_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-mipsel_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-powerpc64le_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-powerpc_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-src.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-win32.zip",
"https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-win64.zip"
]
},
"v4.2.1": {
"id": 127511011,
"tag_name": "v4.2.1",
"html_url": "https://github.com/upx/upx/releases/tag/v4.2.1",
"assets": [
"https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-amd64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-arm64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-arm_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-armeb_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-dos.zip",
"https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-i386_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-mips_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-mipsel_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-powerpc64le_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-powerpc_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-src.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-win32.zip",
"https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-win64.zip"
]
},
"v4.2.0": {
"id": 126740650,
"tag_name": "v4.2.0",
"html_url": "https://github.com/upx/upx/releases/tag/v4.2.0",
"assets": [
"https://github.com/upx/upx/releases/download/v4.2.0/upx-4.2.0-amd64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.0/upx-4.2.0-arm64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.0/upx-4.2.0-arm_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.0/upx-4.2.0-armeb_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.0/upx-4.2.0-dos.zip",
"https://github.com/upx/upx/releases/download/v4.2.0/upx-4.2.0-i386_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.0/upx-4.2.0-mips_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.0/upx-4.2.0-mipsel_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.0/upx-4.2.0-powerpc64le_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.0/upx-4.2.0-powerpc_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.0/upx-4.2.0-src.tar.xz",
"https://github.com/upx/upx/releases/download/v4.2.0/upx-4.2.0-win32.zip",
"https://github.com/upx/upx/releases/download/v4.2.0/upx-4.2.0-win64.zip"
]
},
"v4.1.0": {
"id": 115584145,
"tag_name": "v4.1.0",
"html_url": "https://github.com/upx/upx/releases/tag/v4.1.0",
"assets": [
"https://github.com/upx/upx/releases/download/v4.1.0/upx-4.1.0-amd64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.1.0/upx-4.1.0-arm64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.1.0/upx-4.1.0-arm_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.1.0/upx-4.1.0-armeb_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.1.0/upx-4.1.0-dos.zip",
"https://github.com/upx/upx/releases/download/v4.1.0/upx-4.1.0-i386_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.1.0/upx-4.1.0-mips_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.1.0/upx-4.1.0-mipsel_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.1.0/upx-4.1.0-powerpc64le_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.1.0/upx-4.1.0-powerpc_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.1.0/upx-4.1.0-src.tar.xz",
"https://github.com/upx/upx/releases/download/v4.1.0/upx-4.1.0-win32.zip",
"https://github.com/upx/upx/releases/download/v4.1.0/upx-4.1.0-win64.zip"
]
},
"v4.0.2": {
"id": 90665948,
"tag_name": "v4.0.2",
"html_url": "https://github.com/upx/upx/releases/tag/v4.0.2",
"assets": [
"https://github.com/upx/upx/releases/download/v4.0.2/upx-4.0.2-amd64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.2/upx-4.0.2-arm64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.2/upx-4.0.2-arm_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.2/upx-4.0.2-armeb_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.2/upx-4.0.2-dos.zip",
"https://github.com/upx/upx/releases/download/v4.0.2/upx-4.0.2-i386_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.2/upx-4.0.2-mips_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.2/upx-4.0.2-mipsel_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.2/upx-4.0.2-powerpc64le_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.2/upx-4.0.2-powerpc_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.2/upx-4.0.2-src.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.2/upx-4.0.2-win32.zip",
"https://github.com/upx/upx/releases/download/v4.0.2/upx-4.0.2-win64.zip"
]
},
"v4.0.1": {
"id": 83324543,
"tag_name": "v4.0.1",
"html_url": "https://github.com/upx/upx/releases/tag/v4.0.1",
"assets": [
"https://github.com/upx/upx/releases/download/v4.0.1/upx-4.0.1-amd64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.1/upx-4.0.1-arm64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.1/upx-4.0.1-arm_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.1/upx-4.0.1-armeb_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.1/upx-4.0.1-dos.zip",
"https://github.com/upx/upx/releases/download/v4.0.1/upx-4.0.1-i386_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.1/upx-4.0.1-mips_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.1/upx-4.0.1-mipsel_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.1/upx-4.0.1-powerpc64le_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.1/upx-4.0.1-powerpc_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.1/upx-4.0.1-src.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.1/upx-4.0.1-win32.zip",
"https://github.com/upx/upx/releases/download/v4.0.1/upx-4.0.1-win64.zip"
]
},
"v4.0.0": {
"id": 81373677,
"tag_name": "v4.0.0",
"html_url": "https://github.com/upx/upx/releases/tag/v4.0.0",
"assets": [
"https://github.com/upx/upx/releases/download/v4.0.0/upx-4.0.0-amd64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.0/upx-4.0.0-arm64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.0/upx-4.0.0-arm_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.0/upx-4.0.0-armeb_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.0/upx-4.0.0-dos.zip",
"https://github.com/upx/upx/releases/download/v4.0.0/upx-4.0.0-i386_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.0/upx-4.0.0-mips_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.0/upx-4.0.0-mipsel_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.0/upx-4.0.0-powerpc64le_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.0/upx-4.0.0-powerpc_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.0/upx-4.0.0-src.tar.xz",
"https://github.com/upx/upx/releases/download/v4.0.0/upx-4.0.0-win32.zip",
"https://github.com/upx/upx/releases/download/v4.0.0/upx-4.0.0-win64.zip"
]
},
"v3.99": {
"id": 81217748,
"tag_name": "v3.99",
"html_url": "https://github.com/upx/upx/releases/tag/v3.99",
"assets": [
"https://github.com/upx/upx/releases/download/v3.99/upx-3.99-src.tar.xz"
]
},
"v3.96": {
"id": 23054413,
"tag_name": "v3.96",
"html_url": "https://github.com/upx/upx/releases/tag/v3.96",
"assets": [
"https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.96/upx-3.96-arm64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.96/upx-3.96-arm_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.96/upx-3.96-armeb_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.96/upx-3.96-dos.zip",
"https://github.com/upx/upx/releases/download/v3.96/upx-3.96-i386_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.96/upx-3.96-mips_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.96/upx-3.96-mipsel_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.96/upx-3.96-powerpc64le_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.96/upx-3.96-powerpc_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.96/upx-3.96-src.tar.xz",
"https://github.com/upx/upx/releases/download/v3.96/upx-3.96-win32.zip",
"https://github.com/upx/upx/releases/download/v3.96/upx-3.96-win64.zip"
]
},
"v3.95": {
"id": 12577195,
"tag_name": "v3.95",
"html_url": "https://github.com/upx/upx/releases/tag/v3.95",
"assets": [
"https://github.com/upx/upx/releases/download/v3.95/upx-3.95-amd64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.95/upx-3.95-arm64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.95/upx-3.95-arm_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.95/upx-3.95-armeb_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.95/upx-3.95-dos.zip",
"https://github.com/upx/upx/releases/download/v3.95/upx-3.95-i386_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.95/upx-3.95-mips_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.95/upx-3.95-mipsel_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.95/upx-3.95-powerpc64le_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.95/upx-3.95-powerpc_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.95/upx-3.95-src.tar.xz",
"https://github.com/upx/upx/releases/download/v3.95/upx-3.95-win32.zip",
"https://github.com/upx/upx/releases/download/v3.95/upx-3.95-win64.zip"
]
},
"v3.94": {
"id": 6366171,
"tag_name": "v3.94",
"html_url": "https://github.com/upx/upx/releases/tag/v3.94",
"assets": [
"https://github.com/upx/upx/releases/download/v3.94/upx-3.94-amd64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.94/upx-3.94-armeb_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.94/upx-3.94-i386_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.94/upx-3.94-mipsel_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.94/upx-3.94-powerpc_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.94/upx-3.94-src.tar.xz",
"https://github.com/upx/upx/releases/download/v3.94/upx394a.zip",
"https://github.com/upx/upx/releases/download/v3.94/upx394d.zip",
"https://github.com/upx/upx/releases/download/v3.94/upx394w.zip",
"https://github.com/upx/upx/releases/download/v3.94/upx394wce.zip"
]
},
"v3.93": {
"id": 5296538,
"tag_name": "v3.93",
"html_url": "https://github.com/upx/upx/releases/tag/v3.93",
"assets": [
"https://github.com/upx/upx/releases/download/v3.93/upx-3.93-amd64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.93/upx-3.93-armeb_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.93/upx-3.93-i386_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.93/upx-3.93-mipsel_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.93/upx-3.93-powerpc_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.93/upx-3.93-src.tar.xz",
"https://github.com/upx/upx/releases/download/v3.93/upx393a.zip",
"https://github.com/upx/upx/releases/download/v3.93/upx393d.zip",
"https://github.com/upx/upx/releases/download/v3.93/upx393w.zip",
"https://github.com/upx/upx/releases/download/v3.93/upx393wce.zip"
]
},
"v3.92": {
"id": 4888235,
"tag_name": "v3.92",
"html_url": "https://github.com/upx/upx/releases/tag/v3.92",
"assets": [
"https://github.com/upx/upx/releases/download/v3.92/upx-3.92-amd64_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.92/upx-3.92-armeb_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.92/upx-3.92-i386_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.92/upx-3.92-mipsel_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.92/upx-3.92-powerpc_linux.tar.xz",
"https://github.com/upx/upx/releases/download/v3.92/upx-3.92-src.tar.xz",
"https://github.com/upx/upx/releases/download/v3.92/upx392a.zip",
"https://github.com/upx/upx/releases/download/v3.92/upx392d.zip",
"https://github.com/upx/upx/releases/download/v3.92/upx392w.zip",
"https://github.com/upx/upx/releases/download/v3.92/upx392wce.zip"
]
},
"v3.91": {
"id": 4087014,
"tag_name": "v3.91",
"html_url": "https://github.com/upx/upx/releases/tag/v3.91",
"assets": [
"https://github.com/upx/upx/releases/download/v3.91/upx-3.91-amd64_linux.tar.bz2",
"https://github.com/upx/upx/releases/download/v3.91/upx-3.91-armeb_linux.tar.bz2",
"https://github.com/upx/upx/releases/download/v3.91/upx-3.91-i386_linux.tar.bz2",
"https://github.com/upx/upx/releases/download/v3.91/upx-3.91-mipsel_linux.tar.bz2",
"https://github.com/upx/upx/releases/download/v3.91/upx-3.91-powerpc_linux.tar.bz2",
"https://github.com/upx/upx/releases/download/v3.91/upx-3.91-src.tar.bz2",
"https://github.com/upx/upx/releases/download/v3.91/upx391a.zip",
"https://github.com/upx/upx/releases/download/v3.91/upx391d.zip",
"https://github.com/upx/upx/releases/download/v3.91/upx391w.zip",
"https://github.com/upx/upx/releases/download/v3.91/upx391wce.zip"
]
},
"v3.00": {
"id": 4258222,
"tag_name": "v3.00",
"html_url": "https://github.com/upx/upx/releases/tag/v3.00",
"assets": []
}
}

46
.github/workflows/automerge.yml vendored Normal file
View File

@ -0,0 +1,46 @@
name: automerge
on:
pull_request:
types:
- labeled
- unlabeled
- synchronize
- unlocked
check_suite:
types:
- completed
status: {}
jobs:
dependabot:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
steps:
-
name: Approve
uses: actions/github-script@0.9.0
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
await github.pulls.createReview({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.pull_request.number,
event: 'APPROVE'
})
-
name: Wait
run: sleep 3
-
name: Merge
uses: actions/github-script@0.9.0
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
await github.pulls.merge({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.pull_request.number,
merge_method: 'squash'
})

View File

@ -1,25 +1,12 @@
name: ci
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: read
on:
schedule:
- cron: '0 10 * * *'
pull_request:
branches:
- master
push:
branches:
- 'master'
- 'releases/v*'
tags:
- 'v*'
pull_request:
paths-ignore:
- '.github/upx-releases.json'
- master
jobs:
ci:
@ -33,55 +20,33 @@ jobs:
version:
- latest
- v3.95
include:
- os: ubuntu-latest
file: https://github.com/crazy-max/firefox-history-merger/releases/download/2.4.0/firefox-history-merger-linux-amd64
- os: windows-latest
file: https://github.com/crazy-max/firefox-history-merger/releases/download/2.4.0/firefox-history-merger-windows-4.0-amd64.exe
steps:
-
name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v2
-
name: Download files
shell: bash
name: Download file
id: download
run: |
mkdir ./bin
if [ "${{ matrix.os }}" = "windows-latest" ]; then
curl -sSLk https://github.com/crazy-max/firefox-history-merger/releases/download/2.4.0/firefox-history-merger-windows-4.0-386.exe -o ./bin/firefox-history-merger-windows-4.0-386.exe
curl -sSLk https://github.com/crazy-max/firefox-history-merger/releases/download/2.4.0/firefox-history-merger-windows-4.0-amd64.exe -o ./bin/firefox-history-merger-windows-4.0-amd64.exe
if [ "${{ matrix.os }}" == "windows-latest" ]; then
curl -sSLk ${{ matrix.file }} -o ./bin/firefox-history-merger.exe
echo ::set-output name=filename::./bin/firefox-history-merger.exe
else
curl -sSLk https://github.com/crazy-max/firefox-history-merger/releases/download/2.4.0/firefox-history-merger-linux-386 -o ./bin/firefox-history-merger-linux-386
curl -sSLk https://github.com/crazy-max/firefox-history-merger/releases/download/2.4.0/firefox-history-merger-linux-amd64 -o ./bin/firefox-history-merger-linux-amd64
curl -sSLk ${{ matrix.file }} -o ./bin/firefox-history-merger
chmod +x ./bin/firefox-history-merger
echo ::set-output name=filename::./bin/firefox-history-merger
fi
chmod +x ./bin/firefox-history-merger*
shell: bash
-
name: UPX
uses: ./
with:
version: ${{ matrix.version }}
files: |
./bin/firefox-history-merger*
file: ${{ steps.download.outputs.filename }}
args: -fq
install-only:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
version:
- latest
- v4.0.2
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: UPX
uses: ./
with:
version: ${{ matrix.version }}
install-only: true
-
name: Verify
run: |
which upx
upx --version

View File

@ -1,13 +1,5 @@
name: labels
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: read
on:
push:
branches:
@ -15,25 +7,17 @@ on:
paths:
- '.github/labels.yml'
- '.github/workflows/labels.yml'
pull_request:
paths:
- '.github/labels.yml'
- '.github/workflows/labels.yml'
jobs:
labeler:
runs-on: ubuntu-latest
permissions:
# same as global permissions
contents: read
# required to update labels
issues: write
steps:
-
name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v2
-
name: Run Labeler
uses: crazy-max/ghaction-github-labeler@v5
with:
dry-run: ${{ github.event_name == 'pull_request' }}
if: success()
uses: crazy-max/ghaction-github-labeler@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

24
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,24 @@
name: lint
on:
pull_request:
paths:
- '.github/workflows/lint.yml'
- 'src/*'
jobs:
lint:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up Node
uses: actions/setup-node@v1
-
name: Setup TS
run: npm install tslint typescript -g
-
name: Lint check
run: tslint './src/*.ts'

36
.github/workflows/master.yml vendored Normal file
View File

@ -0,0 +1,36 @@
name: master
on:
push:
branches:
- master
jobs:
prune:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Build
run: |
npm install
npm run format
npm run build
-
name: Set up Git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
-
name: Commit and push changes
run: |
git add .
if output=$(git status --porcelain) && [ ! -z "$output" ]; then
git commit -m 'Update generated content'
git push
fi

View File

@ -1,38 +1,36 @@
name: test
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: read
on:
pull_request:
branches:
- master
push:
branches:
- 'master'
- 'releases/v*'
pull_request:
paths-ignore:
- '.github/upx-releases.json'
- master
jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v2
-
name: Install
run: npm install
-
name: Test
uses: docker/bake-action@v6
with:
source: .
targets: test
run: npm run test
-
name: Upload coverage
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v1
if: success()
with:
files: ./coverage/clover.xml
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/clover.xml

View File

@ -1,66 +0,0 @@
name: upx-releases-json
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: read
on:
workflow_dispatch:
schedule:
- cron: '0 */12 * * *'
push:
branches:
- 'master'
pull_request:
paths-ignore:
- '.github/upx-releases.json'
jobs:
generate:
uses: crazy-max/.github/.github/workflows/releases-json.yml@fa6141aedf23596fb8bdcceab9cce8dadaa31bd9
with:
repository: upx/upx
artifact_name: upx-releases-json
filename: upx-releases.json
secrets: inherit
open-pr:
runs-on: ubuntu-22.04
if: github.event_name != 'pull_request'
permissions:
# required to create PR
contents: write
pull-requests: write
needs:
- generate
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Download
uses: actions/download-artifact@v4
with:
name: upx-releases-json
path: .github
-
name: Commit changes
run: |
git add -A .
-
name: Create PR
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
base: master
branch: bot/upx-releases-json
commit-message: "update .github/upx-releases.json"
signoff: true
delete-branch: true
title: "Update `.github/upx-releases.json`"
body: |
Update `.github/upx-releases.json` to keep in sync with [https://github.com/upx/upx](https://github.com/upx/upx).
draft: false

View File

@ -1,49 +0,0 @@
name: validate
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: read
on:
push:
branches:
- 'master'
- 'releases/v*'
pull_request:
paths-ignore:
- '.github/upx-releases.json'
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
targets: ${{ steps.generate.outputs.targets }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: List targets
id: generate
uses: docker/bake-action/subaction/list-targets@v6
with:
target: validate
validate:
runs-on: ubuntu-latest
needs:
- prepare
strategy:
fail-fast: false
matrix:
target: ${{ fromJson(needs.prepare.outputs.targets) }}
steps:
-
name: Validate
uses: docker/bake-action@v6
with:
targets: ${{ matrix.target }}

71
.gitignore vendored
View File

@ -1,5 +1,12 @@
# https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
/.dev
node_modules/
lib
# Jetbrains
/.idea
/*.iml
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
logs
*.log
@ -7,7 +14,6 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
@ -18,14 +24,34 @@ pids
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
@ -35,19 +61,36 @@ jspm_packages/
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
# dotenv environment variables file
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
.env.test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/

View File

@ -1,6 +0,0 @@
# Dependency directories
node_modules/
jspm_packages/
# yarn v2
.yarn/

File diff suppressed because one or more lines are too long

View File

@ -1,13 +0,0 @@
logFilters:
- code: YN0013
level: discard
- code: YN0019
level: discard
- code: YN0076
level: discard
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

28
CHANGELOG.md Normal file
View File

@ -0,0 +1,28 @@
# Changelog
## 1.3.2 (2020/05/11)
* Update README
## 1.3.1 (2020/05/07)
* Code cleanup
## 1.3.0 (2020/05/06)
* Use native tools
* Add Codecov
* Update deps
## 1.2.0 (2020/04/09)
* Use ncc and clean workflows
* Update deps
## 1.1.0 (2020/01/17)
* Update deps
## 1.0.0 (2020/01/17)
* Initial version

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2020-2025 CrazyMax
Copyright (c) 2020 CrazyMax
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
[![GitHub release](https://img.shields.io/github/release/crazy-max/ghaction-upx.svg?style=flat-square)](https://github.com/crazy-max/ghaction-upx/releases/latest)
[![GitHub marketplace](https://img.shields.io/badge/marketplace-upx--github--action-blue?logo=github&style=flat-square)](https://github.com/marketplace/actions/upx-github-action)
[![Test workflow](https://img.shields.io/github/actions/workflow/status/crazy-max/ghaction-upx/test.yml?branch=master&label=test&logo=github&style=flat-square)](https://github.com/crazy-max/ghaction-upx/actions?workflow=test)
[![Test workflow](https://img.shields.io/github/workflow/status/crazy-max/ghaction-upx/test?label=test&logo=github&style=flat-square)](https://github.com/crazy-max/ghaction-upx/actions?workflow=test)
[![Codecov](https://img.shields.io/codecov/c/github/crazy-max/ghaction-upx?logo=codecov&style=flat-square)](https://codecov.io/gh/crazy-max/ghaction-upx)
[![Become a sponsor](https://img.shields.io/badge/sponsor-crazy--max-181717.svg?logo=github&style=flat-square)](https://github.com/sponsors/crazy-max)
[![Paypal Donate](https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal&style=flat-square)](https://www.paypal.me/crazyws)
@ -9,23 +9,13 @@
GitHub Action for [UPX](https://github.com/upx/upx), the Ultimate Packer for eXecutables.
![Screenshot](.github/ghaction-upx.png)
___
* [Usage](#usage)
* [Customizing](#customizing)
* [inputs](#inputs)
* [Limitation](#limitation)
* [Contributing](#contributing)
* [License](#license)
## Usage
```yaml
name: upx
on:
pull_request:
push:
jobs:
@ -34,65 +24,35 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v2
-
name: Run UPX
uses: crazy-max/ghaction-upx@v3
uses: crazy-max/ghaction-upx@v1
with:
version: latest
files: |
./bin/*.exe
file: ./bin/mybinary
args: -fq
```
If you just want to install UPX:
```yaml
name: upx
on:
push:
jobs:
upx:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Install UPX
uses: crazy-max/ghaction-upx@v3
with:
install-only: true
-
name: UPX version
run: upx --version
```
## Customizing
### inputs
The following inputs can be used as `step.with` keys
Following inputs can be used as `step.with` keys
| Name | Type | Default | Description |
|----------------|--------|----------|------------------------------------------------------------|
| `version` | String | `latest` | UPX version. Example: `v3.95` |
| `files` | String | | Newline-delimited list of path globs for files to compress |
| `args` | String | | Arguments to pass to UPX |
| `install-only` | String | `false` | Just install UPX |
| Name | Type | Default | Description |
|---------------|---------|-----------|---------------------------------|
| `version` | String | `latest` | UPX version. Example: `v3.95` |
| `file` | String | | File to compress (**required**) |
| `args` | String | | Arguments to pass to UPX |
## Limitation
This action is only available for Linux and Windows [virtual environments](https://help.github.com/en/articles/virtual-environments-for-github-actions#supported-virtual-environments-and-hardware-resources).
## Contributing
## How can I help ?
Want to contribute? Awesome! The most basic way to show your support is to star
the project, or to raise issues. You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max)
or by making a [PayPal donation](https://www.paypal.me/crazyws) to ensure this
journey continues indefinitely!
All kinds of contributions are welcome :raised_hands:! The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon: You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) :clap: or by making a [Paypal donation](https://www.paypal.me/crazyws) to ensure this journey continues indefinitely! :rocket:
Thanks again for your support, it is much appreciated! :pray:

View File

@ -1,90 +0,0 @@
import {describe, expect, it} from '@jest/globals';
import * as context from '../src/context';
import * as core from '@actions/core';
import * as path from 'path';
describe('getInputList', () => {
it('handles single line correctly', async () => {
await setInput('foo', 'bar');
const res = await context.getInputList(core.getInput('foo'));
expect(res).toEqual(['bar']);
});
it('handles multiple lines correctly', async () => {
setInput('foo', 'bar\nbaz');
const res = await context.getInputList(core.getInput('foo'));
expect(res).toEqual(['bar', 'baz']);
});
it('remove empty lines correctly', async () => {
setInput('foo', 'bar\n\nbaz');
const res = await context.getInputList(core.getInput('foo'));
expect(res).toEqual(['bar', 'baz']);
});
it('handles comma correctly', async () => {
setInput('foo', 'bar,baz');
const res = await context.getInputList(core.getInput('foo'));
expect(res).toEqual(['bar', 'baz']);
});
it('remove empty result correctly', async () => {
setInput('foo', 'bar,baz,');
const res = await context.getInputList(core.getInput('foo'));
expect(res).toEqual(['bar', 'baz']);
});
it('handles different new lines correctly', async () => {
setInput('foo', 'bar\r\nbaz');
const res = await context.getInputList(core.getInput('foo'));
expect(res).toEqual(['bar', 'baz']);
});
it('handles different new lines and comma correctly', async () => {
setInput('foo', 'bar\r\nbaz,bat');
const res = await context.getInputList(core.getInput('foo'));
expect(res).toEqual(['bar', 'baz', 'bat']);
});
it('handles multiple lines and ignoring comma correctly', async () => {
setInput('files', './bin/binary.exe\n./bin/binary2.exe');
const res = await context.getInputList(core.getInput('files'), true);
expect(res).toEqual(['./bin/binary.exe', './bin/binary2.exe']);
});
it('handles different new lines and ignoring comma correctly', async () => {
setInput('driver-opts', './bin/binary.exe\r\n./bin/binary2.exe');
const res = await context.getInputList(core.getInput('files'), true);
expect(res).toEqual(['./bin/binary.exe', './bin/binary2.exe']);
});
});
describe('asyncForEach', () => {
it('executes async tasks sequentially', async () => {
const testValues = [1, 2, 3, 4, 5];
const results: number[] = [];
await context.asyncForEach(testValues, async value => {
results.push(value);
});
expect(results).toEqual(testValues);
});
});
describe('resolvePaths', () => {
it('resolve files given a set of paths', async () => {
expect(
context.resolvePaths([path.join(__dirname, 'fixtures/data/**/*').split(path.sep).join(path.posix.sep)])
).toEqual([path.join(__dirname, 'fixtures/data/foo/bar.txt').split(path.sep).join(path.posix.sep)]);
});
});
// See: https://github.com/actions/toolkit/blob/master/packages/core/src/core.ts#L67
function getInputName(name: string): string {
return `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
}
function setInput(name: string, value: string): void {
process.env[getInputName(name)] = value;
}

View File

@ -1 +0,0 @@
scan me

17
__tests__/github.test.ts Normal file
View File

@ -0,0 +1,17 @@
import * as github from '../src/github';
describe('github', () => {
it('returns latest UPX GitHub release', async () => {
const release = await github.getRelease('latest');
console.log(release);
expect(release).not.toBeNull();
expect(release?.tag_name).not.toEqual('');
});
it('returns v3.96 GoReleaser GitHub release', async () => {
const release = await github.getRelease('v3.96');
console.log(release);
expect(release).not.toBeNull();
expect(release?.tag_name).toEqual('v3.96');
});
});

View File

@ -1,39 +1,16 @@
import {describe, expect, it} from '@jest/globals';
import * as fs from 'fs';
import fs = require('fs');
import * as installer from '../src/installer';
describe('getRelease', () => {
it('returns latest UPX GitHub release', async () => {
const release = await installer.getRelease('latest');
expect(release).not.toBeNull();
expect(release?.tag_name).not.toEqual('');
});
it('returns v3.95 UPX GitHub release', async () => {
const release = await installer.getRelease('v3.95');
expect(release).not.toBeNull();
expect(release?.id).toEqual(12577195);
expect(release?.tag_name).toEqual('v3.95');
expect(release?.html_url).toEqual('https://github.com/upx/upx/releases/tag/v3.95');
});
it('unknown release', async () => {
await expect(installer.getRelease('foo')).rejects.toThrow(
new Error(
'Cannot find UPX release foo in https://raw.githubusercontent.com/crazy-max/ghaction-upx/master/.github/upx-releases.json'
)
);
});
});
describe('installer', () => {
it('acquires v3.95 version of UPX', async () => {
const upx = await installer.getUPX('v3.95');
console.log(upx);
expect(fs.existsSync(upx)).toBe(true);
}, 100000);
it('acquires latest version of UPX', async () => {
const upx = await installer.getUPX('latest');
console.log(upx);
expect(fs.existsSync(upx)).toBe(true);
}, 100000);
});

View File

@ -11,22 +11,13 @@ inputs:
description: 'UPX version. Example: 3.95'
default: 'latest'
required: false
files:
description: 'Newline-delimited list of path globs for files to compress'
required: false
file:
description: 'File to compress'
required: true
args:
description: 'Arguments to pass to UPX'
required: false
file:
deprecationMessage: 'file is deprecated. Please use files input instead.'
description: 'File to compress'
required: false
install-only:
description: 'Just install upx'
default: 'false'
required: false
runs:
using: 'node20'
using: 'node12'
main: 'dist/index.js'

View File

@ -1,12 +0,0 @@
comment: false
coverage:
status:
project: # settings affecting project coverage
default:
target: auto # auto % coverage target
threshold: 5% # allow for 5% reduction of coverage without failing
patch: off
github_checks:
annotations: false

View File

@ -1,82 +0,0 @@
# syntax=docker/dockerfile:1
ARG NODE_VERSION=20
FROM node:${NODE_VERSION}-alpine AS base
RUN apk add --no-cache cpio findutils git
WORKDIR /src
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache <<EOT
corepack enable
yarn --version
yarn config set --home enableTelemetry 0
EOT
FROM base AS deps
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn install && mkdir /vendor && cp yarn.lock /vendor
FROM scratch AS vendor-update
COPY --from=deps /vendor /
FROM deps AS vendor-validate
RUN --mount=type=bind,target=.,rw <<EOT
set -e
git add -A
cp -rf /vendor/* .
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor-update"'
git status --porcelain -- yarn.lock
exit 1
fi
EOT
FROM deps AS build
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn run build && mkdir /out && cp -Rf dist /out/
FROM scratch AS build-update
COPY --from=build /out /
FROM build AS build-validate
RUN --mount=type=bind,target=.,rw <<EOT
set -e
git add -A
cp -rf /out/* .
if [ -n "$(git status --porcelain -- dist)" ]; then
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
git status --porcelain -- dist
exit 1
fi
EOT
FROM deps AS format
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn run format \
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out
FROM scratch AS format-update
COPY --from=format /out /
FROM deps AS lint
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn run lint
FROM deps AS test
ENV RUNNER_TEMP=/tmp/github_runner
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn run test --coverage --coverageDirectory=/tmp/coverage
FROM scratch AS test-coverage
COPY --from=test /tmp/coverage /

4948
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

1
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

427
dist/licenses.txt generated vendored
View File

@ -1,427 +0,0 @@
@actions/core
MIT
The MIT License (MIT)
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@actions/exec
MIT
The MIT License (MIT)
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@actions/http-client
MIT
Actions Http Client for Node.js
Copyright (c) GitHub, Inc.
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@actions/io
MIT
The MIT License (MIT)
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@actions/tool-cache
MIT
The MIT License (MIT)
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@fastify/busboy
MIT
Copyright Brian White. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
balanced-match
MIT
(MIT)
Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
brace-expansion
MIT
MIT License
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
concat-map
MIT
This software is released under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
fs.realpath
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
----
This library bundles a version of the `fs.realpath` and `fs.realpathSync`
methods from Node.js v0.10 under the terms of the Node.js MIT license.
Node's license follows, also included at the header of `old.js` which contains
the licensed code:
Copyright Joyent, Inc. and other Node contributors.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
glob
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
## Glob Logo
Glob's logo created by Tanya Brassie <http://tanyabrassie.com/>, licensed
under a Creative Commons Attribution-ShareAlike 4.0 International License
https://creativecommons.org/licenses/by-sa/4.0/
inflight
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
inherits
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
minimatch
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
once
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
path-is-absolute
MIT
The MIT License (MIT)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
semver
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
tunnel
MIT
The MIT License (MIT)
Copyright (c) 2012 Koichi Kobayashi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
undici
MIT
MIT License
Copyright (c) Matteo Collina and Undici contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
wrappy
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

1
dist/sourcemap-register.js generated vendored

File diff suppressed because one or more lines are too long

View File

@ -1,61 +0,0 @@
target "_common" {
args = {
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
}
}
group "default" {
targets = ["build"]
}
group "pre-checkin" {
targets = ["vendor-update", "format", "build"]
}
group "validate" {
targets = ["lint", "build-validate", "vendor-validate"]
}
target "build" {
dockerfile = "dev.Dockerfile"
target = "build-update"
output = ["."]
}
target "build-validate" {
inherits = ["_common"]
dockerfile = "dev.Dockerfile"
target = "build-validate"
output = ["type=cacheonly"]
}
target "format" {
dockerfile = "dev.Dockerfile"
target = "format-update"
output = ["."]
}
target "lint" {
dockerfile = "dev.Dockerfile"
target = "lint"
output = ["type=cacheonly"]
}
target "vendor-update" {
dockerfile = "dev.Dockerfile"
target = "vendor-update"
output = ["."]
}
target "vendor-validate" {
inherits = ["_common"]
dockerfile = "dev.Dockerfile"
target = "vendor-validate"
output = ["type=cacheonly"]
}
target "test" {
dockerfile = "dev.Dockerfile"
target = "test-coverage"
output = ["./coverage"]
}

View File

@ -1,12 +1,11 @@
module.exports = {
clearMocks: true,
testEnvironment: 'node',
moduleFileExtensions: ['js', 'ts'],
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
testRunner: 'jest-circus/runner',
transform: {
'^.+\\.ts$': 'ts-jest'
},
collectCoverageFrom: ['src/**/{!(main.ts),}.ts'],
coveragePathIgnorePatterns: ['dist/', 'node_modules/', '__tests__/'],
verbose: true
};
verbose: false
}

5428
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -3,15 +3,12 @@
"description": "GitHub Action for UPX, the Ultimate Packer for eXecutables",
"main": "lib/main.js",
"scripts": {
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
"lint": "yarn run prettier && yarn run eslint",
"format": "yarn run prettier:fix && yarn run eslint:fix",
"eslint": "eslint --max-warnings=0 .",
"eslint:fix": "eslint --fix .",
"prettier": "prettier --check \"./**/*.ts\"",
"prettier:fix": "prettier --write \"./**/*.ts\"",
"test": "jest",
"all": "yarn run build && yarn run format && yarn test"
"build": "tsc && ncc build",
"test": "jest --coverage",
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"cleanup-paths": "removeNPMAbsolutePaths ./ --force --fields _where _args",
"pre-checkin": "npm run format && npm run cleanup-paths && npm run build"
},
"repository": {
"type": "git",
@ -23,26 +20,23 @@
],
"author": "CrazyMax",
"license": "MIT",
"packageManager": "yarn@3.6.3",
"dependencies": {
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"@actions/http-client": "^2.2.3",
"@actions/tool-cache": "^2.0.2"
"@actions/core": "^1.2.4",
"@actions/exec": "^1.0.4",
"@actions/http-client": "^1.0.8",
"@actions/tool-cache": "^1.3.4"
},
"devDependencies": {
"@types/node": "^20.6.0",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"@vercel/ncc": "^0.38.0",
"eslint": "^8.49.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.6.4",
"prettier": "^3.0.3",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
"@types/jest": "^25.2.1",
"@types/node": "^13.13.5",
"@zeit/ncc": "^0.22.1",
"jest": "^25.5.4",
"jest-circus": "^25.5.4",
"jest-runtime": "^25.5.4",
"prettier": "^2.0.5",
"removeNPMAbsolutePaths": "^2.0.0",
"ts-jest": "^25.5.1",
"typescript": "^3.8.3",
"typescript-formatter": "^7.2.2"
}
}

View File

@ -1,44 +0,0 @@
import * as glob from 'glob';
import {lstatSync} from 'fs';
import * as core from '@actions/core';
export interface Inputs {
version: string;
files: string[];
args: string;
installOnly: boolean;
}
export async function getInputs(): Promise<Inputs> {
return {
version: core.getInput('version') || 'latest',
files: getInputList(core.getInput('files') || core.getInput('file'), true),
args: core.getInput('args'),
installOnly: core.getBooleanInput('install-only')
};
}
export function getInputList(items: string, ignoreComma?: boolean): string[] {
if (items == '') {
return [];
}
return items
.split(/\r?\n/)
.filter(x => x)
.reduce<string[]>(
(acc, line) => acc.concat(!ignoreComma ? line.split(',').filter(x => x) : line).map(pat => pat.trim()),
[]
);
}
export const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array);
}
};
export const resolvePaths = (patterns: string[]): string[] => {
return patterns.reduce((acc: string[], pattern: string): string[] => {
return acc.concat(glob.sync(pattern).filter(path => lstatSync(path).isFile()));
}, []);
};

12
src/github.ts Normal file
View File

@ -0,0 +1,12 @@
import * as httpm from '@actions/http-client';
export interface GitHubRelease {
id: number;
tag_name: string;
}
export const getRelease = async (version: string): Promise<GitHubRelease | null> => {
const url: string = `https://github.com/upx/upx/releases/${version}`;
const http: httpm.HttpClient = new httpm.HttpClient('ghaction-upx');
return (await http.getJson<GitHubRelease>(url)).result;
};

View File

@ -1,92 +1,52 @@
import * as os from 'os';
import * as path from 'path';
import * as util from 'util';
import * as github from './github';
import * as core from '@actions/core';
import * as httpm from '@actions/http-client';
import * as tc from '@actions/tool-cache';
const osPlat: string = os.platform();
const osArch: string = os.arch();
export interface GitHubRelease {
id: number;
tag_name: string;
html_url: string;
assets: Array<string>;
}
export const getRelease = async (version: string): Promise<GitHubRelease> => {
const url = `https://raw.githubusercontent.com/crazy-max/ghaction-upx/master/.github/upx-releases.json`;
const http: httpm.HttpClient = new httpm.HttpClient('ghaction-upx');
const resp: httpm.HttpClientResponse = await http.get(url);
const body = await resp.readBody();
const statusCode = resp.message.statusCode || 500;
if (statusCode >= 400) {
throw new Error(`Failed to get UPX release ${version} from ${url} with status code ${statusCode}: ${body}`);
}
const releases = <Record<string, GitHubRelease>>JSON.parse(body);
if (!releases[version]) {
throw new Error(`Cannot find UPX release ${version} in ${url}`);
}
return releases[version];
};
export async function getUPX(version: string): Promise<string> {
const release: GitHubRelease = await getRelease(version);
const release: github.GitHubRelease | null = await github.getRelease(version);
if (!release) {
throw new Error(`Cannot find UPX ${version} release`);
}
const semver: string = release.tag_name.replace(/^v/, '');
core.info(`UPX ${semver} found`);
core.info(`✅ UPX version found: ${semver}`);
const filename = util.format('%s.%s', getName(semver), osPlat == 'win32' ? 'zip' : 'tar.xz');
const downloadUrl = util.format('https://github.com/upx/upx/releases/download/v%s/%s', semver, filename);
core.startGroup(`Downloading ${downloadUrl}...`);
core.info(`⬇️ Downloading ${downloadUrl}...`);
const downloadPath: string = await tc.downloadTool(downloadUrl);
core.info(`Downloaded to ${downloadPath}`);
core.debug(`Downloaded to ${downloadPath}`);
core.info('📦 Extracting UPX...');
let extPath: string;
if (osPlat == 'win32') {
extPath = await tc.extractZip(downloadPath);
} else {
extPath = await tc.extractTar(downloadPath, undefined, 'x');
}
core.info(`Extracted to ${extPath}`);
core.debug(`Extracted to ${extPath}`);
const cachePath: string = await tc.cacheDir(extPath, 'ghaction-upx', semver);
core.debug(`Cached to ${cachePath}`);
const exePath: string = path.join(cachePath, getName(semver), osPlat == 'win32' ? 'upx.exe' : 'upx');
core.debug(`Exe path is ${exePath}`);
core.endGroup();
return exePath;
}
function getName(version: string): string {
let platform: string;
switch (osArch) {
case 'x64': {
platform = osPlat === 'win32' ? 'win64' : 'amd64_' + osPlat;
break;
}
case 'x32': {
platform = osPlat === 'win32' ? 'win32' : 'i386_' + osPlat;
break;
}
case 'arm': {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const arm_version = (process.config.variables as any).arm_version;
if (arm_version === '7') {
platform = 'armeb_' + osPlat;
} else {
platform = 'arm_' + osPlat;
}
break;
}
default: {
platform = osArch + '_' + osPlat;
break;
}
let platform: string = '';
if (osPlat == 'win32') {
platform = osArch == 'x64' ? 'win64' : 'win32';
} else if (osPlat == 'linux') {
platform = osArch == 'x64' ? 'amd64_linux' : 'i386_linux';
}
return util.format('upx-%s-%s', version, platform);
}

View File

@ -1,6 +1,5 @@
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import * as context from './context';
import * as installer from './installer';
import * as core from '@actions/core';
import * as exec from '@actions/exec';
@ -12,27 +11,19 @@ async function run(): Promise<void> {
return;
}
const inputs: context.Inputs = await context.getInputs();
const upx = await installer.getUPX(inputs.version);
const version = core.getInput('version') || 'latest';
const file = core.getInput('file', {required: true});
const args = core.getInput('args');
if (inputs.installOnly) {
const dir = path.dirname(upx);
core.addPath(dir);
core.debug(`Added ${dir} to PATH`);
if (!fs.existsSync(file)) {
core.setFailed(`File to compress not found: ${file}`);
return;
}
const files: string[] = context.resolvePaths(inputs.files);
if (files.length == 0) {
core.warning(`No files were found. Please check the 'files' input.`);
return;
}
const upx = await installer.getUPX(version);
await context.asyncForEach(files, async filepath => {
core.startGroup(`Compressing ${filepath}...`);
await exec.exec(`${upx} ${inputs.args} ${filepath}`);
core.endGroup();
});
core.info('🏃 Running UPX...');
await exec.exec(`${upx} ${args} ${file}`);
} catch (error) {
core.setFailed(error.message);
}

View File

@ -1,19 +1,17 @@
{
"compilerOptions": {
"esModuleInterop": true,
"target": "es6",
"module": "commonjs",
"lib": [
"es6"
],
"newLine": "lf",
"outDir": "./lib",
"rootDir": "./src",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitAny": false,
"resolveJsonModule": true,
"useUnknownInCatchVariables": false,
"esModuleInterop": true,
"sourceMap": true
},
"exclude": [
"node_modules",
"**/*.test.ts",
"jest.config.ts"
]
"exclude": ["node_modules", "**/*.test.ts"]
}

5575
yarn.lock

File diff suppressed because it is too large Load Diff