Use CircleCI version 2.1 at the top of your .circleci/config.yml file.
1
version: 2.1
Add the orbs
stanza below your version, invoking the orb:
1
2
orbs:
upx: circleci/upx@1.0.2
Use upx
elements in your existing workflows and jobs.
Install UPX and pack an executable (compiled_binary).
1
2
3
4
5
6
7
8
9
10
11
12
version: '2.1'
orbs:
upx: circleci/upx@x.y
jobs:
build:
docker:
- image: cimg/go:1.14
steps:
- upx/install
- upx/pack:
binary: compiled_binary
workflows: null
Install UPX, with an optional version lock.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
install_location | Location to install UPX to, which will be added to PATH. | No | /home/circleci/upx/bin | string |
version | Version of UPX to use. | No | '3.96' | string |
List some information about a packed file.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
binary | Binary file to list. | Yes | - | string |
Run installed UPX.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
binary | Binary file to pack. | Yes | - | string |
brute | Whether to try all available compression methods & filters. | No | false | boolean |
level | Packing/compression level, 1 being least, 9 being most. Defaults to 7. | No | 7 | integer |
Test a UPX packed binary.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
binary | Binary file to test. | Yes | - | string |
Unpack a UPX packed binary.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
binary | Binary file to unpack. | Yes | - | string |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# This code is licensed from CircleCI to the user under the MIT license.
# See here for details: https://circleci.com/developer/orbs/licensing
version: 2.1
description: |
This orb is no longer supported by CircleCI because of limited or no use. If you would like to use this orb or create your own version feel free to fork the repository and use the following https://circleci.com/blog/building-private-orbs/ as a guide to making this orb into a private orb for your own use. Install and use "the Ultimate Packer for eXecutables" in your builds.
display:
homepage: https://upx.github.io/
source_url: https://github.com/CircleCI-Public/UPX-orb
commands:
install:
description: |
Install UPX, with an optional version lock.
parameters:
install_location:
default: /home/circleci/upx/bin
description: Location to install UPX to, which will be added to PATH.
type: string
version:
default: "3.96"
description: Version of UPX to use.
type: string
steps:
- restore_cache:
keys:
- upx-cache-<< parameters.version >>
- upx-cache-
- run:
command: |
echo 'export PATH=$PATH:<< parameters.install_location >>' >> $BASH_ENV
if [ ! -f "<< parameters.install_location >>/upx" ]; then
wget https://github.com/upx/upx/releases/download/v<< parameters.version >>/upx-<< parameters.version >>-amd64_linux.tar.xz
tar xf upx-<< parameters.version >>-amd64_linux.tar.xz
mkdir -p << parameters.install_location >>
mv upx-<< parameters.version >>-amd64_linux/upx << parameters.install_location >>
chmod +x << parameters.install_location >>/upx
fi
name: Install UPX
- save_cache:
key: upx-cache-<< parameters.version >>
paths:
- << parameters.install_location >>
list:
description: |
List some information about a packed file.
parameters:
binary:
description: Binary file to list.
type: string
steps:
- run:
command: upx -l << parameters.binary >>
name: List << parameters.binary >>
pack:
description: |
Run installed UPX.
parameters:
binary:
description: Binary file to pack.
type: string
brute:
default: false
description: Whether to try all available compression methods & filters.
type: boolean
level:
default: 7
description: Packing/compression level, 1 being least, 9 being most. Defaults to 7.
type: integer
steps:
- run:
command: upx <<# parameters.brute >> --brute <</ parameters.brute >> << parameters.binary >> -<< parameters.level >> --no-progress
name: Pack << parameters.binary >>
test:
description: |
Test a UPX packed binary.
parameters:
binary:
description: Binary file to test.
type: string
steps:
- run:
command: upx -t << parameters.binary >>
name: Test << parameters.binary >>
unpack:
description: |
Unpack a UPX packed binary.
parameters:
binary:
description: Binary file to unpack.
type: string
steps:
- run:
command: upx -d << parameters.binary >>
name: Unpack << parameters.binary >>
examples:
install_and_pack:
description: |
Install UPX and pack an executable (compiled_binary).
usage:
version: "2.1"
orbs:
upx: circleci/upx@x.y
jobs:
build:
docker:
- image: cimg/go:1.14
steps:
- upx/install
- upx/pack:
binary: compiled_binary
workflows: null