mirror of
https://github.com/crazy-max/ghaction-upx.git
synced 2026-04-14 10:32:59 -06:00
Compare commits
191 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d17dec12c | ||
|
|
c619ac25e7 | ||
|
|
b8d61b28e9 | ||
|
|
217a1bd1f9 | ||
|
|
f7e908e5b9 | ||
|
|
84033c6664 | ||
|
|
15e7963e05 | ||
|
|
754ef232a0 | ||
|
|
dbf74e34eb | ||
|
|
918a9dd3cd | ||
|
|
48ab6ba97a | ||
|
|
24851354e2 | ||
|
|
97d457995a | ||
|
|
aa4e82eb0f | ||
|
|
34f1525686 | ||
|
|
ceda108afe | ||
|
|
7fdadc3d8b | ||
|
|
bc2a7f0205 | ||
|
|
76aba877ac | ||
|
|
d43ef3b8fc | ||
|
|
663f81ff55 | ||
|
|
0ecb9bbbf3 | ||
|
|
d9dbb9c3ca | ||
|
|
2034dbc765 | ||
|
|
2b3459b026 | ||
|
|
76c12355bd | ||
|
|
c544706a19 | ||
|
|
c26e09cbb4 | ||
|
|
4c84b78119 | ||
|
|
66ae810f53 | ||
|
|
6f73f46fce | ||
|
|
99ca5b010b | ||
|
|
04c1b0be04 | ||
|
|
ce00daae27 | ||
|
|
7648f29744 | ||
|
|
7d4b8f5604 | ||
|
|
a584dfa158 | ||
|
|
001bed2881 | ||
|
|
4cd391c02d | ||
|
|
39152071b7 | ||
|
|
cd7336ce6f | ||
|
|
9a5a78f329 | ||
|
|
503b2cafe4 | ||
|
|
81cdab3516 | ||
|
|
6a7ea9d3b5 | ||
|
|
f2cd5c8bcf | ||
|
|
d3d674826f | ||
|
|
18fa74d3c7 | ||
|
|
04f08f9455 | ||
|
|
809cb08e23 | ||
|
|
c4d364e37a | ||
|
|
eb67a7a701 | ||
|
|
4fce58bf0c | ||
|
|
461ecd9597 | ||
|
|
f8b60c9628 | ||
|
|
9b23a6fac7 | ||
|
|
f23c8215b7 | ||
|
|
745b8598ff | ||
|
|
b761847537 | ||
|
|
a4c77c24d7 | ||
|
|
54ced3d059 | ||
|
|
81c243439e | ||
|
|
ec1f8096e1 | ||
|
|
9f2ed58b4e | ||
|
|
b7511689c6 | ||
|
|
3ebfd4c3ac | ||
|
|
9e3f61b245 | ||
|
|
a81b371a71 | ||
|
|
acc3d0d5e3 | ||
|
|
1069732c84 | ||
|
|
d114a3cea9 | ||
|
|
ab164ca748 | ||
|
|
35ddca1ce9 | ||
|
|
a816ebd088 | ||
|
|
86ff19095b | ||
|
|
fa38cda44f | ||
|
|
3cedaab34e | ||
|
|
e5fb52be38 | ||
|
|
768453fe74 | ||
|
|
5b59beecb8 | ||
|
|
8ca2932d09 | ||
|
|
9f1bde9a57 | ||
|
|
325d0a4087 | ||
|
|
7070b31d6a | ||
|
|
4910783e91 | ||
|
|
1ebf61db85 | ||
|
|
925acc7207 | ||
|
|
228b9aebd5 | ||
|
|
32f88c4e79 | ||
|
|
4ef79548f1 | ||
|
|
d478341167 | ||
|
|
7a73864628 | ||
|
|
5d94edca26 | ||
|
|
056e68db2b | ||
|
|
806d622b77 | ||
|
|
701c9836f7 | ||
|
|
55283a30e8 | ||
|
|
cb13001a65 | ||
|
|
cf88c4c484 | ||
|
|
18d403fe1c | ||
|
|
f035e40172 | ||
|
|
dd12917b20 | ||
|
|
8fa57f5c85 | ||
|
|
00028a370a | ||
|
|
2e09f2928e | ||
|
|
5d83a9a0c6 | ||
|
|
a3effd42d8 | ||
|
|
ac6f831c34 | ||
|
|
5b3b22175b | ||
|
|
de721e4e07 | ||
|
|
5c71834a86 | ||
|
|
f4329194de | ||
|
|
75f4155f72 | ||
|
|
d70db65c1f | ||
|
|
d5a5499c65 | ||
|
|
b9529948d1 | ||
|
|
07026276a2 | ||
|
|
2c088ed672 | ||
|
|
2e7eb9b637 | ||
|
|
3e1ab9a87c | ||
|
|
16fd2cd4ef | ||
|
|
f98597f4ad | ||
|
|
1205c841da | ||
|
|
0e24772845 | ||
|
|
7bc47bb6a0 | ||
|
|
c1508a05a8 | ||
|
|
a3dc3906b4 | ||
|
|
cbee808295 | ||
|
|
baf9dbcb82 | ||
|
|
33c9c2e18f | ||
|
|
1290965b7a | ||
|
|
662405c113 | ||
|
|
de3060bd27 | ||
|
|
a7cc326d6c | ||
|
|
366580d55c | ||
|
|
a036543072 | ||
|
|
ca56e9169c | ||
|
|
9a4ad86134 | ||
|
|
53a31d336c | ||
|
|
557e617797 | ||
|
|
6ea5068f0f | ||
|
|
d2071be44b | ||
|
|
4c4869581a | ||
|
|
8e8e4b8c59 | ||
|
|
03544b5b3e | ||
|
|
1412a4b386 | ||
|
|
58600ce61a | ||
|
|
e163ff0d2e | ||
|
|
3b3d2b898d | ||
|
|
88a78e2f11 | ||
|
|
6837697d11 | ||
|
|
5cc6b8eb5b | ||
|
|
f1338960fb | ||
|
|
0569f84afe | ||
|
|
4258956a57 | ||
|
|
ce8d5a88dc | ||
|
|
798798f112 | ||
|
|
93bb242097 | ||
|
|
6395a3aa2f | ||
|
|
232b78f307 | ||
|
|
3a9e38d798 | ||
|
|
9e29288823 | ||
|
|
5fb44a383c | ||
|
|
a77f62c7b2 | ||
|
|
4016520b1a | ||
|
|
43e96ba7c7 | ||
|
|
84be82804b | ||
|
|
1d77879094 | ||
|
|
a49a31ec57 | ||
|
|
4e207aef79 | ||
|
|
13cfa21ed2 | ||
|
|
cf7c59718e | ||
|
|
3bb5082440 | ||
|
|
2cca363863 | ||
|
|
74f8aad623 | ||
|
|
179c8d1999 | ||
|
|
07776888af | ||
|
|
8109f2b0b1 | ||
|
|
ff1f7b6f02 | ||
|
|
70b04fa8cc | ||
|
|
a29487bfda | ||
|
|
ccf18cffd8 | ||
|
|
85281740bf | ||
|
|
05a76fdd78 | ||
|
|
8028365153 | ||
|
|
b72f85285f | ||
|
|
7030d1d220 | ||
|
|
a6aa6e0fc3 | ||
|
|
d6d7f82212 | ||
|
|
70f3e1534a | ||
|
|
2840f8db19 |
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@@ -0,0 +1,2 @@
|
||||
/coverage
|
||||
/node_modules
|
||||
23
.eslintrc.json
Normal file
23
.eslintrc.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"env": {
|
||||
"node": true,
|
||||
"es2021": true,
|
||||
"jest/globals": true
|
||||
},
|
||||
"extends": [
|
||||
"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"
|
||||
]
|
||||
}
|
||||
22
.github/CONTRIBUTING.md
vendored
22
.github/CONTRIBUTING.md
vendored
@@ -2,18 +2,20 @@
|
||||
|
||||
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://help.github.com/articles/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://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).
|
||||
|
||||
## Submitting a pull request
|
||||
|
||||
1. [Fork](https://github.com/crazy-max/ghaction-upx/fork) and clone the repository
|
||||
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.
|
||||
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.
|
||||
|
||||
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
|
||||
|
||||
@@ -26,5 +28,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://help.github.com/articles/about-pull-requests/)
|
||||
- [GitHub Help](https://help.github.com)
|
||||
- [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)
|
||||
|
||||
34
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
34
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
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://docs.github.com/en/actions/managing-workflow-runs/using-workflow-run-logs#downloading-logs)
|
||||
> and [attach it](https://docs.github.com/en/github/managing-your-work-on-github/file-attachments-on-issues-and-pull-requests) to this issue.
|
||||
29
.github/SUPPORT.md
vendored
Normal file
29
.github/SUPPORT.md
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# Support [](https://isitmaintained.com/project/crazy-max/ghaction-upx)
|
||||
|
||||
## Reporting an issue
|
||||
|
||||
Please do a search in [open issues](https://github.com/crazy-max/ghaction-upx/issues?utf8=%E2%9C%93&q=) to see if the issue or feature request has already been filed.
|
||||
|
||||
If you find your issue already exists, make relevant comments and add your [reaction](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments). Use a reaction in place of a "+1" comment.
|
||||
|
||||
:+1: - upvote
|
||||
|
||||
:-1: - downvote
|
||||
|
||||
If you cannot find an existing issue that describes your bug or feature, submit an issue using the guidelines below.
|
||||
|
||||
## Writing good bug reports and feature requests
|
||||
|
||||
File a single issue per problem and feature request.
|
||||
|
||||
* Do not enumerate multiple bugs or feature requests in the same issue.
|
||||
* Do not add your issue as a comment to an existing issue unless it's for the identical input. Many issues look similar, but have different causes.
|
||||
|
||||
The more information you can provide, the more likely someone will be successful reproducing the issue and finding a fix.
|
||||
|
||||
You are now ready to [create a new issue](https://github.com/crazy-max/ghaction-upx/issues/new/choose)!
|
||||
|
||||
## Closure policy
|
||||
|
||||
* Issues that don't have the information requested above (when applicable) will be closed immediately and the poster directed to the support guidelines.
|
||||
* Issues that go a week without a response from original poster are subject to closure at my discretion.
|
||||
13
.github/dependabot.yml
vendored
13
.github/dependabot.yml
vendored
@@ -1,6 +1,6 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "npm"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
@@ -9,3 +9,14 @@ updates:
|
||||
labels:
|
||||
- ":game_die: dependencies"
|
||||
- ":robot: bot"
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
time: "06:00"
|
||||
timezone: "Europe/Paris"
|
||||
allow:
|
||||
- dependency-type: "production"
|
||||
labels:
|
||||
- ":game_die: dependencies"
|
||||
- ":robot: bot"
|
||||
|
||||
BIN
.github/ghaction-upx.png
vendored
Normal file
BIN
.github/ghaction-upx.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.3 KiB |
26
.github/labels.yml
vendored
26
.github/labels.yml
vendored
@@ -1,4 +1,8 @@
|
||||
## more info https://github.com/crazy-max/ghaction-github-labeler
|
||||
- # automerge
|
||||
name: ":bell: automerge"
|
||||
color: "8f4fbc"
|
||||
description: ""
|
||||
- # bot
|
||||
name: ":robot: bot"
|
||||
color: "69cde9"
|
||||
@@ -43,26 +47,34 @@
|
||||
name: ":pray: help wanted"
|
||||
color: "4caf50"
|
||||
description: ""
|
||||
- # hold
|
||||
name: ":hand: hold"
|
||||
color: "24292f"
|
||||
description: ""
|
||||
- # invalid
|
||||
name: ":no_entry_sign: invalid"
|
||||
color: "e6e6e6"
|
||||
description: ""
|
||||
- # maybe bug
|
||||
name: ":interrobang: maybe bug"
|
||||
color: "ff5722"
|
||||
- # investigate
|
||||
name: ":mag: investigate"
|
||||
color: "e6625b"
|
||||
description: ""
|
||||
- # needs more info
|
||||
name: ":thinking: needs more info"
|
||||
color: "795548"
|
||||
description: ""
|
||||
- # pinned
|
||||
name: ":pushpin: pinned"
|
||||
color: "28008e"
|
||||
description: ""
|
||||
- # question
|
||||
name: ":question: question"
|
||||
color: "3f51b5"
|
||||
description: ""
|
||||
- # sponsor
|
||||
name: ":sparkling_heart: sponsor"
|
||||
color: "fedbf0"
|
||||
description: ""
|
||||
- # stale
|
||||
name: ":skull: stale"
|
||||
color: "237da0"
|
||||
description: ""
|
||||
- # upstream
|
||||
name: ":eyes: upstream"
|
||||
color: "fbca04"
|
||||
|
||||
224
.github/upx-releases.json
vendored
Normal file
224
.github/upx-releases.json
vendored
Normal file
@@ -0,0 +1,224 @@
|
||||
{
|
||||
"latest": {
|
||||
"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.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": [
|
||||
"https://github.com/upx/upx/releases/download/v3.00/bzip2-1.0.6.tar.gz",
|
||||
"https://github.com/upx/upx/releases/download/v3.00/bzip2-1.0.6.tar.xz",
|
||||
"https://github.com/upx/upx/releases/download/v3.00/cacert-20170118.pem.gz",
|
||||
"https://github.com/upx/upx/releases/download/v3.00/config.guess-20170401.gz",
|
||||
"https://github.com/upx/upx/releases/download/v3.00/config.sub-20170401.gz",
|
||||
"https://github.com/upx/upx/releases/download/v3.00/lzma443.tar.gz",
|
||||
"https://github.com/upx/upx/releases/download/v3.00/lzma443.tar.xz",
|
||||
"https://github.com/upx/upx/releases/download/v3.00/lzo-2.10.tar.gz",
|
||||
"https://github.com/upx/upx/releases/download/v3.00/pigz-2.3.4.tar.gz",
|
||||
"https://github.com/upx/upx/releases/download/v3.00/ucl-1.03.tar.gz",
|
||||
"https://github.com/upx/upx/releases/download/v3.00/ucl-1.03.tar.xz",
|
||||
"https://github.com/upx/upx/releases/download/v3.00/xz-5.2.3.tar.gz",
|
||||
"https://github.com/upx/upx/releases/download/v3.00/xz-5.2.3.tar.xz",
|
||||
"https://github.com/upx/upx/releases/download/v3.00/zlib-1.2.11.tar.gz",
|
||||
"https://github.com/upx/upx/releases/download/v3.00/zlib-1.2.11.tar.xz",
|
||||
"https://github.com/upx/upx/releases/download/v3.00/zlib-1.2.3.tar.gz",
|
||||
"https://github.com/upx/upx/releases/download/v3.00/zlib-1.2.3.tar.xz",
|
||||
"https://github.com/upx/upx/releases/download/v3.00/zlib-1.2.8.tar.gz",
|
||||
"https://github.com/upx/upx/releases/download/v3.00/zlib-1.2.8.tar.xz"
|
||||
]
|
||||
}
|
||||
}
|
||||
76
.github/workflows/ci.yml
vendored
76
.github/workflows/ci.yml
vendored
@@ -1,12 +1,21 @@
|
||||
name: ci
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
schedule:
|
||||
- cron: '0 10 * * *'
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'master'
|
||||
- 'releases/v*'
|
||||
tags:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '.github/upx-releases.json'
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
@@ -17,35 +26,58 @@ jobs:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
version: latest
|
||||
file: https://github.com/crazy-max/firefox-history-merger/releases/download/2.4.0/firefox-history-merger-linux-amd64
|
||||
- os: windows-latest
|
||||
version: latest
|
||||
file: https://github.com/crazy-max/firefox-history-merger/releases/download/2.4.0/firefox-history-merger-windows-4.0-amd64.exe
|
||||
version:
|
||||
- latest
|
||||
- v3.95
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Download file
|
||||
id: download
|
||||
name: Download files
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir ./bin
|
||||
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
|
||||
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
|
||||
else
|
||||
curl -sSLk ${{ matrix.file }} -o ./bin/firefox-history-merger
|
||||
chmod +x ./bin/firefox-history-merger
|
||||
echo ::set-output name=filename::./bin/firefox-history-merger
|
||||
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
|
||||
fi
|
||||
shell: bash
|
||||
chmod +x ./bin/firefox-history-merger*
|
||||
-
|
||||
name: UPX
|
||||
uses: ./
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
file: ${{ steps.download.outputs.filename }}
|
||||
files: |
|
||||
./bin/firefox-history-merger*
|
||||
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@v3
|
||||
-
|
||||
name: UPX
|
||||
uses: ./
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
install-only: true
|
||||
-
|
||||
name: Verify
|
||||
run: |
|
||||
which upx
|
||||
upx --version
|
||||
|
||||
13
.github/workflows/labels.yml
vendored
13
.github/workflows/labels.yml
vendored
@@ -1,5 +1,9 @@
|
||||
name: labels
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -13,13 +17,8 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
# https://github.com/actions/checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
# https://github.com/crazy-max/ghaction-github-labeler
|
||||
name: Run Labeler
|
||||
if: success()
|
||||
uses: crazy-max/ghaction-github-labeler@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
uses: crazy-max/ghaction-github-labeler@v4
|
||||
|
||||
22
.github/workflows/lint.yml
vendored
22
.github/workflows/lint.yml
vendored
@@ -1,22 +0,0 @@
|
||||
name: lint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/lint.yml'
|
||||
- 'src/*'
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
# https://github.com/actions/checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
-
|
||||
name: Setup TS
|
||||
run: npm install tslint typescript -g
|
||||
-
|
||||
name: Lint check
|
||||
run: tslint './src/*.ts'
|
||||
41
.github/workflows/master.yml
vendored
41
.github/workflows/master.yml
vendored
@@ -1,41 +0,0 @@
|
||||
name: master
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
prune:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
# https://github.com/actions/checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
-
|
||||
# https://github.com/actions/checkout/issues/6
|
||||
name: Fix detached HEAD
|
||||
run: git checkout ${GITHUB_REF#refs/heads/}
|
||||
-
|
||||
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
|
||||
47
.github/workflows/test.yml
vendored
47
.github/workflows/test.yml
vendored
@@ -1,38 +1,37 @@
|
||||
name: test
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'master'
|
||||
- 'releases/v*'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '.github/upx-releases.json'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
# https://github.com/actions/checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Build
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
-
|
||||
name: Install
|
||||
run: npm ci
|
||||
-
|
||||
name: Build
|
||||
run: npm run build
|
||||
name: Validate
|
||||
uses: docker/bake-action@v3
|
||||
with:
|
||||
targets: validate
|
||||
-
|
||||
name: Test
|
||||
run: npm run test
|
||||
uses: docker/bake-action@v3
|
||||
with:
|
||||
targets: test
|
||||
-
|
||||
name: Upload coverage
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
file: ./coverage/clover.xml
|
||||
|
||||
58
.github/workflows/upx-releases-json.yml
vendored
Normal file
58
.github/workflows/upx-releases-json.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
name: upx-releases-json
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
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@6dc31870ca6c4f8489bf5a408ab38fae60f47eec
|
||||
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'
|
||||
needs:
|
||||
- generate
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Download
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: upx-releases-json
|
||||
path: .github
|
||||
-
|
||||
name: Commit changes
|
||||
run: |
|
||||
git add -A .
|
||||
-
|
||||
name: Create PR
|
||||
uses: peter-evans/create-pull-request@284f54f989303d2699d373481a0cfa13ad5a6666
|
||||
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
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 CrazyMax
|
||||
Copyright (c) 2020-2023 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
|
||||
|
||||
69
README.md
69
README.md
@@ -1,7 +1,7 @@
|
||||
[](https://github.com/crazy-max/ghaction-upx/releases/latest)
|
||||
[](https://github.com/marketplace/actions/upx-github-action)
|
||||
[](https://github.com/crazy-max/ghaction-upx/actions?workflow=release)
|
||||
[](https://github.com/crazy-max/ghaction-upx/actions?workflow=test)
|
||||
[](https://github.com/crazy-max/ghaction-upx/actions?workflow=test)
|
||||
[](https://codecov.io/gh/crazy-max/ghaction-upx)
|
||||
[](https://github.com/sponsors/crazy-max)
|
||||
[](https://www.paypal.me/crazyws)
|
||||
|
||||
@@ -9,15 +9,23 @@
|
||||
|
||||
GitHub Action for [UPX](https://github.com/upx/upx), the Ultimate Packer for eXecutables.
|
||||
|
||||
## Usage
|
||||

|
||||
|
||||
Below is a simple snippet to use this action. A [live example](https://github.com/crazy-max/ghaction-upx/actions) is also available for this repository.
|
||||
___
|
||||
|
||||
* [Usage](#usage)
|
||||
* [Customizing](#customizing)
|
||||
* [inputs](#inputs)
|
||||
* [Limitation](#limitation)
|
||||
* [Contributing](#contributing)
|
||||
* [License](#license)
|
||||
|
||||
## Usage
|
||||
|
||||
```yaml
|
||||
name: upx
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
@@ -26,35 +34,66 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Run UPX
|
||||
uses: crazy-max/ghaction-upx@v1
|
||||
uses: crazy-max/ghaction-upx@v2
|
||||
with:
|
||||
version: latest
|
||||
file: ./bin/mybinary
|
||||
files: |
|
||||
./bin/*.exe
|
||||
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@v3
|
||||
-
|
||||
name: Install UPX
|
||||
uses: crazy-max/ghaction-upx@v2
|
||||
with:
|
||||
install-only: true
|
||||
-
|
||||
name: UPX version
|
||||
run: upx --version
|
||||
```
|
||||
|
||||
## Customizing
|
||||
|
||||
### inputs
|
||||
|
||||
Following inputs can be used as `step.with` keys
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
|---------------|---------|-----------|-------------------------------|
|
||||
| `version` | String | `latest` | UPX version. Example: `3.95` |
|
||||
| `file` | String | | File to compress |
|
||||
| `args` | String | | Arguments to pass to UPX |
|
||||
| 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 |
|
||||
|
||||
## 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).
|
||||
|
||||
## How can I help ?
|
||||
## Contributing
|
||||
|
||||
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:
|
||||
Want to contribute? Awesome! The most basic way to show your support is to star the project, or to raise issues. If
|
||||
you want to open a pull request, please read the [contributing guidelines](.github/CONTRIBUTING.md).
|
||||
|
||||
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!
|
||||
|
||||
Thanks again for your support, it is much appreciated! :pray:
|
||||
|
||||
|
||||
90
__tests__/context.test.ts
Normal file
90
__tests__/context.test.ts
Normal file
@@ -0,0 +1,90 @@
|
||||
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;
|
||||
}
|
||||
1
__tests__/fixtures/data/foo/bar.txt
Normal file
1
__tests__/fixtures/data/foo/bar.txt
Normal file
@@ -0,0 +1 @@
|
||||
scan me
|
||||
@@ -1,9 +1,34 @@
|
||||
import fs = require('fs');
|
||||
import {describe, expect, it} from '@jest/globals';
|
||||
import * as fs from '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.toThrowError(
|
||||
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 3.95 version of UPX', async () => {
|
||||
const upx = await installer.getUPX('3.95');
|
||||
it('acquires v3.95 version of UPX', async () => {
|
||||
const upx = await installer.getUPX('v3.95');
|
||||
expect(fs.existsSync(upx)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
|
||||
19
action.yml
19
action.yml
@@ -10,12 +10,23 @@ inputs:
|
||||
version:
|
||||
description: 'UPX version. Example: 3.95'
|
||||
default: 'latest'
|
||||
file:
|
||||
description: 'File to compress'
|
||||
required: true
|
||||
required: false
|
||||
files:
|
||||
description: 'Newline-delimited list of path globs for files to compress'
|
||||
required: false
|
||||
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: 'node12'
|
||||
using: 'node16'
|
||||
main: 'dist/index.js'
|
||||
|
||||
3
codecov.yml
Normal file
3
codecov.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
comment: false
|
||||
github_checks:
|
||||
annotations: false
|
||||
71
dev.Dockerfile
Normal file
71
dev.Dockerfile
Normal file
@@ -0,0 +1,71 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG NODE_VERSION=16
|
||||
|
||||
FROM node:${NODE_VERSION}-alpine AS base
|
||||
RUN apk add --no-cache cpio findutils git
|
||||
WORKDIR /src
|
||||
|
||||
FROM base AS deps
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--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/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/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/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/node_modules \
|
||||
yarn run test --coverageDirectory=/tmp/coverage
|
||||
|
||||
FROM scratch AS test-coverage
|
||||
COPY --from=test /tmp/coverage /
|
||||
27107
dist/index.js
generated
vendored
27107
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
1
dist/index.js.map
generated
vendored
Normal file
1
dist/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
393
dist/licenses.txt
generated
vendored
Normal file
393
dist/licenses.txt
generated
vendored
Normal file
@@ -0,0 +1,393 @@
|
||||
@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.
|
||||
|
||||
balanced-match
|
||||
MIT
|
||||
(MIT)
|
||||
|
||||
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.
|
||||
|
||||
|
||||
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.
|
||||
|
||||
|
||||
uuid
|
||||
MIT
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2010-2020 Robert Kieffer and other 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
Normal file
1
dist/sourcemap-register.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
53
docker-bake.hcl
Normal file
53
docker-bake.hcl
Normal file
@@ -0,0 +1,53 @@
|
||||
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" {
|
||||
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" {
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "vendor-validate"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "test" {
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "test-coverage"
|
||||
output = ["./coverage"]
|
||||
}
|
||||
@@ -1,11 +1,9 @@
|
||||
module.exports = {
|
||||
clearMocks: true,
|
||||
moduleFileExtensions: ['js', 'ts'],
|
||||
testEnvironment: 'node',
|
||||
testMatch: ['**/*.test.ts'],
|
||||
testRunner: 'jest-circus/runner',
|
||||
transform: {
|
||||
'^.+\\.ts$': 'ts-jest'
|
||||
},
|
||||
verbose: true
|
||||
}
|
||||
};
|
||||
83
lib/installer.js
generated
83
lib/installer.js
generated
@@ -1,83 +0,0 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const download = __importStar(require("download"));
|
||||
const fs = __importStar(require("fs"));
|
||||
const os = __importStar(require("os"));
|
||||
const path = __importStar(require("path"));
|
||||
const util = __importStar(require("util"));
|
||||
const restm = __importStar(require("typed-rest-client/RestClient"));
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const tc = __importStar(require("@actions/tool-cache"));
|
||||
let osPlat = os.platform();
|
||||
let osArch = os.arch();
|
||||
function getUPX(version) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const selected = yield determineVersion(version);
|
||||
if (selected) {
|
||||
version = selected;
|
||||
}
|
||||
core.info(`✅ UPX version found: ${version}`);
|
||||
const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'upx-'));
|
||||
const fileName = getFileName(version);
|
||||
const downloadUrl = util.format('https://github.com/upx/upx/releases/download/v%s/%s', version, fileName);
|
||||
core.info(`⬇️ Downloading ${downloadUrl}...`);
|
||||
yield download.default(downloadUrl, tmpdir, { filename: fileName });
|
||||
core.info('📦 Extracting UPX...');
|
||||
let extPath = tmpdir;
|
||||
if (osPlat == 'win32') {
|
||||
extPath = yield tc.extractZip(`${tmpdir}/${fileName}`);
|
||||
}
|
||||
else {
|
||||
extPath = yield tc.extractTar(`${tmpdir}/${fileName}`, undefined, 'x');
|
||||
}
|
||||
return path.join(extPath, getFileNameWithoutExt(version), osPlat == 'win32' ? 'upx.exe' : 'upx');
|
||||
});
|
||||
}
|
||||
exports.getUPX = getUPX;
|
||||
function getFileName(version) {
|
||||
const ext = osPlat == 'win32' ? 'zip' : 'tar.xz';
|
||||
return util.format('%s.%s', getFileNameWithoutExt(version), ext);
|
||||
}
|
||||
function getFileNameWithoutExt(version) {
|
||||
let platform = '';
|
||||
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);
|
||||
}
|
||||
function determineVersion(version) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let rest = new restm.RestClient('ghaction-upx', 'https://github.com', undefined, {
|
||||
headers: {
|
||||
Accept: 'application/json'
|
||||
}
|
||||
});
|
||||
if (version !== 'latest') {
|
||||
version = `v${version}`;
|
||||
}
|
||||
let res = yield rest.get(`/upx/upx/releases/${version}`);
|
||||
if (res.statusCode != 200 || res.result === null) {
|
||||
throw new Error(`Cannot find UPX ${version} release (http ${res.statusCode})`);
|
||||
}
|
||||
return res.result.tag_name.replace(/^v/, '');
|
||||
});
|
||||
}
|
||||
49
lib/main.js
generated
49
lib/main.js
generated
@@ -1,49 +0,0 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||
result["default"] = mod;
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const installer = __importStar(require("./installer"));
|
||||
const fs = __importStar(require("fs"));
|
||||
const os = __importStar(require("os"));
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const exec = __importStar(require("@actions/exec"));
|
||||
function run(silent) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
if (os.platform() == 'darwin') {
|
||||
core.setFailed('Not supported on darwin platform');
|
||||
return;
|
||||
}
|
||||
const version = core.getInput('version') || 'latest';
|
||||
const file = core.getInput('file', { required: true });
|
||||
const args = core.getInput('args');
|
||||
const upx = yield installer.getUPX(version);
|
||||
if (!fs.existsSync(file)) {
|
||||
core.setFailed(`⛔ File to compress not found: ${file}`);
|
||||
}
|
||||
console.log('🏃 Running UPX...');
|
||||
yield exec.exec(`${upx} ${args} ${file}`, undefined, {
|
||||
silent: silent
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.run = run;
|
||||
run();
|
||||
6594
package-lock.json
generated
6594
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
46
package.json
46
package.json
@@ -2,15 +2,12 @@
|
||||
"name": "upx-github-action",
|
||||
"description": "GitHub Action for UPX, the Ultimate Packer for eXecutables",
|
||||
"main": "lib/main.js",
|
||||
"directories": {
|
||||
"lib": "lib"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc && ncc build",
|
||||
"test": "jest",
|
||||
"format": "prettier --write **/*.ts",
|
||||
"format-check": "prettier --check **/*.ts",
|
||||
"pre-checkin": "npm run format && npm run build"
|
||||
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
|
||||
"lint": "eslint src/**/*.ts __tests__/**/*.ts",
|
||||
"format": "eslint --fix src/**/*.ts __tests__/**/*.ts",
|
||||
"test": "jest --coverage",
|
||||
"all": "yarn run build && yarn run format && yarn test"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -23,23 +20,24 @@
|
||||
"author": "CrazyMax",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.3",
|
||||
"@actions/exec": "^1.0.3",
|
||||
"@actions/tool-cache": "^1.3.3",
|
||||
"download": "^8.0.0",
|
||||
"typed-rest-client": "^1.7.3"
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/http-client": "^2.1.0",
|
||||
"@actions/tool-cache": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^25.2.1",
|
||||
"@types/node": "^13.11.0",
|
||||
"@types/download": "^6.2.4",
|
||||
"@zeit/ncc": "^0.22.1",
|
||||
"jest": "^25.2.7",
|
||||
"jest-circus": "^25.2.7",
|
||||
"jest-runtime": "^25.2.7",
|
||||
"prettier": "^2.0.4",
|
||||
"ts-jest": "^25.3.1",
|
||||
"typescript": "^3.8.3",
|
||||
"typescript-formatter": "^7.2.2"
|
||||
"@types/node": "^16.11.26",
|
||||
"@typescript-eslint/eslint-plugin": "^5.14.0",
|
||||
"@typescript-eslint/parser": "^5.14.0",
|
||||
"@vercel/ncc": "^0.33.3",
|
||||
"eslint": "^8.11.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-jest": "^26.1.1",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"jest": "^27.2.5",
|
||||
"prettier": "^2.3.1",
|
||||
"ts-jest": "^27.1.2",
|
||||
"ts-node": "^10.7.0",
|
||||
"typescript": "^4.4.4"
|
||||
}
|
||||
}
|
||||
|
||||
44
src/context.ts
Normal file
44
src/context.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
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()));
|
||||
}, []);
|
||||
};
|
||||
@@ -1,47 +1,69 @@
|
||||
import * as download from 'download';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import * as util from 'util';
|
||||
import * as restm from 'typed-rest-client/RestClient';
|
||||
import * as core from '@actions/core';
|
||||
import * as httpm from '@actions/http-client';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
|
||||
let osPlat: string = os.platform();
|
||||
let osArch: string = os.arch();
|
||||
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 selected = await determineVersion(version);
|
||||
if (selected) {
|
||||
version = selected;
|
||||
}
|
||||
const release: GitHubRelease = await getRelease(version);
|
||||
const semver: string = release.tag_name.replace(/^v/, '');
|
||||
core.info(`UPX ${semver} found`);
|
||||
|
||||
core.info(`✅ UPX version found: ${version}`);
|
||||
const tmpdir = fs.mkdtempSync(path.join(os.tmpdir(), 'upx-'));
|
||||
const fileName = getFileName(version);
|
||||
const downloadUrl = util.format('https://github.com/upx/upx/releases/download/v%s/%s', version, fileName);
|
||||
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.info(`⬇️ Downloading ${downloadUrl}...`);
|
||||
await download.default(downloadUrl, tmpdir, {filename: fileName});
|
||||
core.startGroup(`Downloading ${downloadUrl}...`);
|
||||
|
||||
core.info('📦 Extracting UPX...');
|
||||
let extPath: string = tmpdir;
|
||||
const downloadPath: string = await tc.downloadTool(downloadUrl);
|
||||
core.info(`Downloaded to ${downloadPath}`);
|
||||
|
||||
let extPath: string;
|
||||
if (osPlat == 'win32') {
|
||||
extPath = await tc.extractZip(`${tmpdir}/${fileName}`);
|
||||
extPath = await tc.extractZip(downloadPath);
|
||||
} else {
|
||||
extPath = await tc.extractTar(`${tmpdir}/${fileName}`, undefined, 'x');
|
||||
extPath = await tc.extractTar(downloadPath, undefined, 'x');
|
||||
}
|
||||
core.info(`Extracted to ${extPath}`);
|
||||
|
||||
return path.join(extPath, getFileNameWithoutExt(version), osPlat == 'win32' ? 'upx.exe' : 'upx');
|
||||
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 getFileName(version: string): string {
|
||||
const ext: string = osPlat == 'win32' ? 'zip' : 'tar.xz';
|
||||
return util.format('%s.%s', getFileNameWithoutExt(version), ext);
|
||||
}
|
||||
|
||||
function getFileNameWithoutExt(version: string): string {
|
||||
let platform: string = '';
|
||||
function getName(version: string): string {
|
||||
let platform = '';
|
||||
if (osPlat == 'win32') {
|
||||
platform = osArch == 'x64' ? 'win64' : 'win32';
|
||||
} else if (osPlat == 'linux') {
|
||||
@@ -49,26 +71,3 @@ function getFileNameWithoutExt(version: string): string {
|
||||
}
|
||||
return util.format('upx-%s-%s', version, platform);
|
||||
}
|
||||
|
||||
interface GitHubRelease {
|
||||
tag_name: string;
|
||||
}
|
||||
|
||||
async function determineVersion(version: string): Promise<string> {
|
||||
let rest: restm.RestClient = new restm.RestClient('ghaction-upx', 'https://github.com', undefined, {
|
||||
headers: {
|
||||
Accept: 'application/json'
|
||||
}
|
||||
});
|
||||
|
||||
if (version !== 'latest') {
|
||||
version = `v${version}`;
|
||||
}
|
||||
|
||||
let res: restm.IRestResponse<GitHubRelease> = await rest.get<GitHubRelease>(`/upx/upx/releases/${version}`);
|
||||
if (res.statusCode != 200 || res.result === null) {
|
||||
throw new Error(`Cannot find UPX ${version} release (http ${res.statusCode})`);
|
||||
}
|
||||
|
||||
return res.result.tag_name.replace(/^v/, '');
|
||||
}
|
||||
|
||||
33
src/main.ts
33
src/main.ts
@@ -1,28 +1,37 @@
|
||||
import * as installer from './installer';
|
||||
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';
|
||||
|
||||
export async function run(silent?: boolean) {
|
||||
async function run(): Promise<void> {
|
||||
try {
|
||||
if (os.platform() == 'darwin') {
|
||||
core.setFailed('Not supported on darwin platform');
|
||||
return;
|
||||
}
|
||||
|
||||
const version = core.getInput('version') || 'latest';
|
||||
const file = core.getInput('file', {required: true});
|
||||
const args = core.getInput('args');
|
||||
const upx = await installer.getUPX(version);
|
||||
const inputs: context.Inputs = await context.getInputs();
|
||||
const upx = await installer.getUPX(inputs.version);
|
||||
|
||||
if (!fs.existsSync(file)) {
|
||||
core.setFailed(`⛔ File to compress not found: ${file}`);
|
||||
if (inputs.installOnly) {
|
||||
const dir = path.dirname(upx);
|
||||
core.addPath(dir);
|
||||
core.debug(`Added ${dir} to PATH`);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('🏃 Running UPX...');
|
||||
await exec.exec(`${upx} ${args} ${file}`, undefined, {
|
||||
silent: silent
|
||||
const files: string[] = context.resolvePaths(inputs.files);
|
||||
if (files.length == 0) {
|
||||
core.warning(`No files were found. Please check the 'files' input.`);
|
||||
return;
|
||||
}
|
||||
|
||||
await context.asyncForEach(files, async filepath => {
|
||||
core.startGroup(`Compressing ${filepath}...`);
|
||||
await exec.exec(`${upx} ${inputs.args} ${filepath}`);
|
||||
core.endGroup();
|
||||
});
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
|
||||
@@ -2,15 +2,19 @@
|
||||
"compilerOptions": {
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"newLine": "lf",
|
||||
"outDir": "./lib",
|
||||
"rootDir": "./src",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"noImplicitAny": false,
|
||||
"esModuleInterop": true
|
||||
"resolveJsonModule": true,
|
||||
"useUnknownInCatchVariables": false,
|
||||
},
|
||||
"exclude": ["node_modules", "**/*.test.ts"]
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"**/*.test.ts",
|
||||
"jest.config.ts"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user