Compare commits

...

55 Commits

Author SHA1 Message Date
CrazyMax
0fc45e9126 Merge pull request #213 from crazy-max/dependabot/github_actions/actions/checkout-4
Bump actions/checkout from 3 to 4
2023-09-10 15:54:38 +02:00
CrazyMax
9465f624dd Merge pull request #215 from crazy-max/update-node20
chore: node 20 as default runtime
2023-09-10 15:54:21 +02:00
CrazyMax
9eba60dcc9 ci: split test and validate workflow 2023-09-10 10:39:51 +02:00
CrazyMax
4fd68cb082 chore: node 20 as default runtime 2023-09-10 05:29:56 +02:00
CrazyMax
81a846ee13 chore: update generated content 2023-09-10 05:29:37 +02:00
CrazyMax
6abbb7ec37 test: fix after jest update 2023-09-10 05:28:51 +02:00
CrazyMax
54c2561f69 chore: update dev dependencies 2023-09-10 05:28:33 +02:00
CrazyMax
d280f9562f chore: update to node 20 2023-09-10 05:23:58 +02:00
CrazyMax
4d946a7137 Merge pull request #214 from crazy-max/update-yarn
chore: update yarn to 3.6.3
2023-09-10 05:21:38 +02:00
CrazyMax
fbfc4f37fe chore: update generated content 2023-09-10 05:04:53 +02:00
CrazyMax
ff4a15c5a4 chore: update yarn to 3.6.3 2023-09-10 04:58:47 +02:00
CrazyMax
392f94885d codecov: update config 2023-09-09 11:50:27 +02:00
dependabot[bot]
deed33da1f Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 19:22:46 +00:00
CrazyMax
e74668b8fe Merge pull request #212 from crazy-max/form-templates
chore: github form templates
2023-09-03 18:01:52 +02:00
CrazyMax
89f782418b chore: github form templates 2023-09-03 18:01:06 +02:00
CrazyMax
91dad0f873 Merge pull request #211 from crazy-max/align-labels
chore: cleanup labels config
2023-09-03 18:00:07 +02:00
CrazyMax
d021f9b324 Merge pull request #204 from crazy-max/dependabot/npm_and_yarn/semver-5.7.2
Bump semver from 5.7.1 to 5.7.2
2023-09-03 17:59:42 +02:00
CrazyMax
d3616beaf8 chore: cleanup labels config 2023-09-03 17:59:17 +02:00
CrazyMax
1d4b28a26b update generated content 2023-09-03 17:58:52 +02:00
CrazyMax
45272fece1 Merge pull request #210 from crazy-max/update-labels
chore: update labels
2023-09-03 17:57:41 +02:00
CrazyMax
5ab3223647 chore: update labels 2023-09-03 17:55:52 +02:00
dependabot[bot]
349653b2d1 Bump semver from 5.7.1 to 5.7.2
Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-03 15:55:20 +00:00
CrazyMax
2409e442cb Merge pull request #206 from crazy-max/dependabot/npm_and_yarn/actions/http-client-2.1.1
Bump @actions/http-client from 2.1.0 to 2.1.1
2023-09-03 17:54:44 +02:00
CrazyMax
d91472faac update generated content 2023-09-03 17:53:56 +02:00
CrazyMax
fd0d6460ff Merge pull request #202 from crazy-max/dependabot/github_actions/peter-evans/create-pull-request-5.0.2
Bump peter-evans/create-pull-request from 5.0.1 to 5.0.2
2023-09-03 17:34:09 +02:00
CrazyMax
d19e416e3c Merge pull request #203 from crazy-max/dependabot/npm_and_yarn/tough-cookie-4.1.3
Bump tough-cookie from 4.0.0 to 4.1.3
2023-09-03 17:33:56 +02:00
CrazyMax
85eb57b388 Merge pull request #207 from crazy-max/bot/upx-releases-json
Update `.github/upx-releases.json`
2023-09-03 17:33:30 +02:00
CrazyMax
71ca9e0465 Merge pull request #209 from crazy-max/dependabot/npm_and_yarn/word-wrap-1.2.5
Bump word-wrap from 1.2.3 to 1.2.5
2023-09-03 17:33:16 +02:00
dependabot[bot]
db3a3050f2 Bump word-wrap from 1.2.3 to 1.2.5
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.5.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.5)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-03 15:32:09 +00:00
crazy-max
e85fa95304 update .github/upx-releases.json
Signed-off-by: GitHub <noreply@github.com>
2023-09-01 00:05:12 +00:00
dependabot[bot]
36e0037c79 Bump @actions/http-client from 2.1.0 to 2.1.1
Bumps [@actions/http-client](https://github.com/actions/toolkit/tree/HEAD/packages/http-client) from 2.1.0 to 2.1.1.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/http-client/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/@actions/http-client@2.1.1/packages/http-client)

---
updated-dependencies:
- dependency-name: "@actions/http-client"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-07 04:16:56 +00:00
dependabot[bot]
82c927c412 Bump tough-cookie from 4.0.0 to 4.1.3
Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) from 4.0.0 to 4.1.3.
- [Release notes](https://github.com/salesforce/tough-cookie/releases)
- [Changelog](https://github.com/salesforce/tough-cookie/blob/master/CHANGELOG.md)
- [Commits](https://github.com/salesforce/tough-cookie/compare/v4.0.0...v4.1.3)

---
updated-dependencies:
- dependency-name: tough-cookie
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-09 15:55:50 +00:00
dependabot[bot]
da2853e8b5 Bump peter-evans/create-pull-request from 5.0.1 to 5.0.2
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 5.0.1 to 5.0.2.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](284f54f989...153407881e)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-14 04:56:47 +00:00
CrazyMax
1d17dec12c readme: install only example 2023-05-03 17:51:04 +02:00
CrazyMax
c619ac25e7 ci: concurrency check 2023-05-03 17:50:31 +02:00
CrazyMax
b8d61b28e9 Merge pull request #195 from crazy-max/dependabot/npm_and_yarn/actions/http-client-2.1.0
Bump @actions/http-client from 2.0.1 to 2.1.0
2023-05-03 17:40:11 +02:00
CrazyMax
217a1bd1f9 update generated content 2023-05-03 17:38:18 +02:00
dependabot[bot]
f7e908e5b9 Bump @actions/http-client from 2.0.1 to 2.1.0
Bumps [@actions/http-client](https://github.com/actions/toolkit/tree/HEAD/packages/http-client) from 2.0.1 to 2.1.0.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/http-client/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/http-client)

---
updated-dependencies:
- dependency-name: "@actions/http-client"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-03 15:35:19 +00:00
CrazyMax
84033c6664 Merge pull request #200 from crazy-max/dependabot/github_actions/peter-evans/create-pull-request-5.0.1
Bump peter-evans/create-pull-request from 4.2.3 to 5.0.1
2023-05-03 17:33:05 +02:00
CrazyMax
15e7963e05 Merge pull request #201 from caarlos0/install-only
feat: install-only
2023-05-03 17:32:15 +02:00
Carlos Alexandro Becker
754ef232a0 Update .github/workflows/ci.yml
Co-authored-by: CrazyMax <github@crazymax.dev>
2023-05-03 09:09:37 -03:00
Carlos Alexandro Becker
dbf74e34eb feat: install-only
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-05-03 01:52:24 +00:00
dependabot[bot]
918a9dd3cd Bump peter-evans/create-pull-request from 4.2.3 to 5.0.1
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 4.2.3 to 5.0.1.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](2b011faafd...284f54f989)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-02 04:56:57 +00:00
CrazyMax
48ab6ba97a Merge pull request #199 from crazy-max/dependabot/github_actions/docker/bake-action-3
Bump docker/bake-action from 2 to 3
2023-05-01 19:14:30 +02:00
dependabot[bot]
24851354e2 Bump docker/bake-action from 2 to 3
Bumps [docker/bake-action](https://github.com/docker/bake-action) from 2 to 3.
- [Release notes](https://github.com/docker/bake-action/releases)
- [Commits](https://github.com/docker/bake-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/bake-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-19 04:56:42 +00:00
CrazyMax
97d457995a Merge pull request #196 from crazy-max/bot/upx-releases-json
Update `.github/upx-releases.json`
2023-03-12 12:44:32 +00:00
crazy-max
aa4e82eb0f update .github/upx-releases.json
Signed-off-by: GitHub <noreply@github.com>
2023-03-12 12:11:44 +00:00
CrazyMax
34f1525686 Bump releases-json action 2023-03-12 13:11:12 +01:00
CrazyMax
ceda108afe update releases json cron 2023-02-18 22:47:01 +01:00
CrazyMax
7fdadc3d8b new year 2023-02-18 22:47:01 +01:00
CrazyMax
bc2a7f0205 Merge pull request #194 from crazy-max/bot/upx-releases-json
Update `.github/upx-releases.json`
2023-02-05 19:28:21 +01:00
crazy-max
76aba877ac update .github/upx-releases.json
Signed-off-by: GitHub <noreply@github.com>
2023-02-05 18:25:36 +00:00
CrazyMax
d43ef3b8fc update releases-json 2023-02-05 19:25:05 +01:00
CrazyMax
663f81ff55 Merge pull request #193 from crazy-max/bot/upx-releases-json
Update `.github/upx-releases.json`
2023-02-05 19:05:04 +01:00
crazy-max
0ecb9bbbf3 update .github/upx-releases.json
Signed-off-by: GitHub <noreply@github.com>
2023-02-05 10:02:32 +00:00
35 changed files with 7638 additions and 3766 deletions

View File

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

3
.eslintignore Normal file
View File

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

View File

@@ -1,11 +1,12 @@
{
"env": {
"node": true,
"es2021": true,
"jest/globals": true
"es6": true,
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
"plugin:prettier/recommended"

2
.gitattributes vendored
View File

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

101
.github/ISSUE_TEMPLATE/bug.yml vendored Normal file
View File

@@ -0,0 +1,101 @@
# 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.

View File

@@ -1,34 +0,0 @@
---
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.

6
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,6 @@
# 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.

15
.github/ISSUE_TEMPLATE/feature.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
# 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

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

128
.github/labels.yml vendored
View File

@@ -1,85 +1,69 @@
## more info https://github.com/crazy-max/ghaction-github-labeler
- # automerge
name: ":bell: automerge"
color: "8f4fbc"
description: ""
- # bot
name: ":robot: bot"
-
name: "bot"
color: "69cde9"
description: ""
- # bug
name: ":bug: bug"
color: "b60205"
description: ""
- # dependencies
name: ":game_die: dependencies"
color: "0366d6"
description: ""
- # documentation
name: ":memo: documentation"
color: "c5def5"
description: ""
- # duplicate
name: ":busts_in_silhouette: duplicate"
color: "cccccc"
description: ""
- # enhancement
name: ":sparkles: enhancement"
color: "0054ca"
description: ""
- # 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"
-
name: "good first issue"
color: "7057ff"
description: ""
- # help wanted
name: ":pray: help wanted"
-
name: "help wanted"
color: "4caf50"
description: ""
- # invalid
name: ":no_entry_sign: invalid"
-
name: "area/ci"
color: "ed9ca9"
description: ""
-
name: "kind/bug"
color: "b60205"
description: ""
-
name: "kind/dependencies"
color: "0366d6"
description: ""
-
name: "kind/docs"
color: "c5def5"
description: ""
-
name: "kind/duplicate"
color: "cccccc"
description: ""
-
name: "kind/enhancement"
color: "0054ca"
description: ""
-
name: "kind/invalid"
color: "e6e6e6"
description: ""
- # 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"
-
name: "kind/upstream"
color: "fbca04"
description: ""
- # wontfix
name: ":coffin: wontfix"
-
name: "kind/wontfix"
color: "ffffff"
description: ""
-
name: "status/automerge"
color: "8f4fbc"
description: ""
-
name: "status/needs-investigation"
color: "e6625b"
description: ""
-
name: "status/needs-more-info"
color: "795548"
description: ""
-
name: "status/stale"
color: "237da0"
description: ""
-
name: "status/triage"
color: "dde4b7"
description: ""

File diff suppressed because one or more lines are too long

View File

@@ -1,8 +1,12 @@
name: ci
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
schedule:
- cron: '0 10 * * *' # everyday at 10am
- cron: '0 10 * * *'
push:
branches:
- 'master'
@@ -28,7 +32,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Download files
shell: bash
@@ -50,3 +54,30 @@ jobs:
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@v4
-
name: UPX
uses: ./
with:
version: ${{ matrix.version }}
install-only: true
-
name: Verify
run: |
which upx
upx --version

View File

@@ -1,5 +1,9 @@
name: labels
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
@@ -7,6 +11,10 @@ on:
paths:
- '.github/labels.yml'
- '.github/workflows/labels.yml'
pull_request:
paths:
- '.github/labels.yml'
- '.github/workflows/labels.yml'
jobs:
labeler:
@@ -14,7 +22,9 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Run Labeler
uses: crazy-max/ghaction-github-labeler@v4
with:
dry-run: ${{ github.event_name == 'pull_request' }}

View File

@@ -1,5 +1,9 @@
name: test
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
@@ -15,15 +19,10 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Validate
uses: docker/bake-action@v2
with:
targets: validate
uses: actions/checkout@v4
-
name: Test
uses: docker/bake-action@v2
uses: docker/bake-action@v3
with:
targets: test
-

View File

@@ -7,7 +7,7 @@ concurrency:
on:
workflow_dispatch:
schedule:
- cron: '0 10 * * 0'
- cron: '0 */12 * * *'
push:
branches:
- 'master'
@@ -17,7 +17,7 @@ on:
jobs:
generate:
uses: crazy-max/.github/.github/workflows/releases-json.yml@002654044825b3c2b9856af61b8a2aaf389706b1
uses: crazy-max/.github/.github/workflows/releases-json.yml@6dc31870ca6c4f8489bf5a408ab38fae60f47eec
with:
repository: upx/upx
artifact_name: upx-releases-json
@@ -32,7 +32,7 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Download
uses: actions/download-artifact@v3
@@ -45,7 +45,7 @@ jobs:
git add -A .
-
name: Create PR
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
with:
base: master
branch: bot/upx-releases-json

45
.github/workflows/validate.yml vendored Normal file
View File

@@ -0,0 +1,45 @@
name: validate
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- 'master'
- 'releases/v*'
pull_request:
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
targets: ${{ steps.targets.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Targets matrix
id: targets
run: |
echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT
validate:
runs-on: ubuntu-latest
needs:
- prepare
strategy:
fail-fast: false
matrix:
target: ${{ fromJson(needs.prepare.outputs.targets) }}
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Validate
uses: docker/bake-action@v3
with:
targets: ${{ matrix.target }}

71
.gitignore vendored
View File

@@ -1,12 +1,5 @@
/.dev
node_modules/
lib
# https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
# Jetbrains
/.idea
/*.iml
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
logs
*.log
@@ -14,6 +7,7 @@ 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
@@ -24,34 +18,14 @@ 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
@@ -61,36 +35,19 @@ typings/
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
# dotenv environment variable files
.env
.env.test
.env.development.local
.env.test.local
.env.production.local
.env.local
# 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/
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

6
.prettierignore Normal file
View File

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

File diff suppressed because one or more lines are too long

874
.yarn/releases/yarn-3.6.3.cjs vendored Normal file

File diff suppressed because one or more lines are too long

15
.yarnrc.yml Normal file
View File

@@ -0,0 +1,15 @@
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"
yarnPath: .yarn/releases/yarn-3.6.3.cjs

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2020-2022 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

View File

@@ -45,17 +45,43 @@ jobs:
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: `v3.95` |
| `files` | String | | Newline-delimited list of path globs for files to compress (**required**) |
| `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

View File

@@ -18,7 +18,7 @@ describe('getRelease', () => {
});
it('unknown release', async () => {
await expect(installer.getRelease('foo')).rejects.toThrowError(
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'
)

View File

@@ -21,7 +21,12 @@ inputs:
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: 'node16'
using: 'node20'
main: 'dist/index.js'

View File

@@ -1,3 +1,12 @@
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,13 +1,15 @@
# syntax=docker/dockerfile:1
ARG NODE_VERSION=16
ARG NODE_VERSION=20
FROM node:${NODE_VERSION}-alpine AS base
RUN apk add --no-cache cpio findutils git
RUN yarn config set --home enableTelemetry 0
WORKDIR /src
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
@@ -28,6 +30,7 @@ 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/
@@ -48,6 +51,7 @@ 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
@@ -57,6 +61,7 @@ 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
@@ -64,8 +69,9 @@ 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 --coverageDirectory=/tmp/coverage
yarn run test --coverage --coverageDirectory=/tmp/coverage
FROM scratch AS test-coverage
COPY --from=test /tmp/coverage /

2
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

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

View File

@@ -4,9 +4,13 @@
"main": "lib/main.js",
"scripts": {
"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",
"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"
},
"repository": {
@@ -19,25 +23,26 @@
],
"author": "CrazyMax",
"license": "MIT",
"packageManager": "yarn@3.6.3",
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1",
"@actions/http-client": "^2.0.1",
"@actions/http-client": "^2.1.1",
"@actions/tool-cache": "^2.0.1"
},
"devDependencies": {
"@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"
"@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"
}
}

View File

@@ -6,13 +6,15 @@ 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')
args: core.getInput('args'),
installOnly: core.getBooleanInput('install-only')
};
}

View File

@@ -1,4 +1,5 @@
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';
@@ -14,6 +15,13 @@ async function run(): Promise<void> {
const inputs: context.Inputs = await context.getInputs();
const upx = await installer.getUPX(inputs.version);
if (inputs.installOnly) {
const dir = path.dirname(upx);
core.addPath(dir);
core.debug(`Added ${dir} to PATH`);
return;
}
const files: string[] = context.resolvePaths(inputs.files);
if (files.length == 0) {
core.warning(`No files were found. Please check the 'files' input.`);

View File

@@ -1,13 +1,12 @@
{
"compilerOptions": {
"esModuleInterop": true,
"target": "es6",
"module": "commonjs",
"newLine": "lf",
"outDir": "./lib",
"rootDir": "./src",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitAny": false,
"resolveJsonModule": true,
"useUnknownInCatchVariables": false,

9113
yarn.lock

File diff suppressed because it is too large Load Diff