image_optim_pack 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 485671ab97a671783e2c82e97e314d6357cdf876aed8a7204544a4b99b941027
4
- data.tar.gz: 87ae97230127d09301cad73baa7321b21f553c9ed2b1a34642ad4715a6896bce
3
+ metadata.gz: 5336b548f94c7dbfc592eba04905c20498c57e11707031b98687ca9200521044
4
+ data.tar.gz: 914ccdc01d012e114754edb2d9fcd8bc28ebfa434400d2a318038a09fe5ffe13
5
5
  SHA512:
6
- metadata.gz: 21083f41e2bb802f5664e55ee7a1c2d0ee47e449b9ca608efb1fe9873a23974eefb719d30429d2b200b0d221bd9d329999589ead24e16f9ef074c9cc7b52bbb1
7
- data.tar.gz: 215fda23456e52270e8d1a89cd0715a858792f4ccd0b37ca630efa9ea36181b86c45c133b83ab3be6afaf8ddc9b2c05d25a5f88b0056dace727347ed970402b7
6
+ metadata.gz: b67b322a157e968edab7d72d2623c043c323726d0c9e97a542239b401f727ea210208e951e9d92ec034cdc8832b02bea254c720075f3d97130e53ce563767368
7
+ data.tar.gz: 042a729d0b4c3b68b9976359e8d6ddf5620a7ef04e4fd01df84d0c1b5a7457339a1b1cc210d2c3ec9fe2c069da7272914336e4e681a2da2093d0fb6e01277cdf
@@ -0,0 +1,38 @@
1
+ name: livecheck
2
+ on:
3
+ schedule:
4
+ - cron: 34 5 * * *
5
+ workflow_dispatch:
6
+ inputs:
7
+ retry:
8
+ description: 'Retry attempt'
9
+ required: true
10
+ type: number
11
+ jobs:
12
+ livecheck:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v2
16
+ - uses: ruby/setup-ruby@v1
17
+ with:
18
+ ruby-version: '3.1'
19
+ bundler-cache: true
20
+ - run: |
21
+ bundle exec script/livecheck || if (( $? == 1 )); then
22
+ exit 1
23
+ else
24
+ echo '::set-output name=RETRY::1'
25
+ fi
26
+ id: livecheck
27
+ - if: ${{ steps.livecheck.outputs.RETRY }}
28
+ env:
29
+ RETRY: ${{ inputs.retry }}
30
+ RETRIES: 10
31
+ GITHUB_TOKEN: ${{ secrets.RETRY_TOKEN }}
32
+ run: |
33
+ if (( ${RETRY:-0} < $RETRIES )); then
34
+ sleep 300
35
+ gh workflow run livecheck --repo $GITHUB_REPOSITORY --ref $GITHUB_REF_NAME -f retry=$(( $RETRY + 1 ))
36
+ else
37
+ exit 1
38
+ fi
data/.rubocop.yml CHANGED
@@ -64,6 +64,8 @@ Style/HashEachMethods:
64
64
  Enabled: true
65
65
 
66
66
  Style/HashSyntax:
67
+ Exclude:
68
+ - script/livecheck
67
69
  EnforcedStyle: hash_rockets
68
70
 
69
71
  Style/HashTransformKeys:
data/CHANGELOG.markdown CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## unreleased
4
4
 
5
+ ## v0.9.1 (2022-08-29)
6
+
7
+ * libmozjpeg 4.1.1 [@toy](https://github.com/toy)
8
+
5
9
  ## v0.9.0 (2022-06-11)
6
10
 
7
11
  * Add [pngout](http://advsys.net/ken/utils.htm) (since January 2021 license allows redistrubition for freely distributed non-commercial projects) [#24](https://github.com/toy/image_optim_pack/issues/24) [@toy](https://github.com/toy)
data/Makefile CHANGED
@@ -9,7 +9,7 @@ JPEGARCHIVE_VER := 2.2.0
9
9
  JPEGOPTIM_VER := 1.4.7
10
10
  LIBJPEG_VER := 9e
11
11
  LIBLCMS_VER := 2.13
12
- LIBMOZJPEG_VER := 4.0.3
12
+ LIBMOZJPEG_VER := 4.1.1
13
13
  LIBPNG_VER := 1.6.37
14
14
  LIBZ_VER := 1.2.11
15
15
  OPTIPNG_VER := 0.7.7
@@ -206,21 +206,21 @@ ldd-version :; $(ldd) --version
206
206
 
207
207
  define check_exists
208
208
  @test -f $(OUTPUT_DIR)/$1 || \
209
- { printf "$1: $(ANSI_RED)not found$(ANSI_RESET)\n"; exit 1; }
209
+ { printf "%s: $(ANSI_RED)not found$(ANSI_RESET)\n" "$1"; exit 1; }
210
210
  endef
211
211
 
212
212
  define check_version
213
213
  @$(OUTPUT_DIR)/$1 $2 | fgrep -q "$3" || \
214
- { printf "$1: $(ANSI_RED)Expected $3, got $$($(OUTPUT_DIR)/$1 $2)$(ANSI_RESET)\n"; exit 1; }
214
+ { printf "%s: $(ANSI_RED)Expected %s, got %s$(ANSI_RESET)\n" "$1" "$3" "$$($(OUTPUT_DIR)/$1 $2)"; exit 1; }
215
215
  endef
216
216
 
217
217
  define check_arch
218
218
  @file -b $(OUTPUT_DIR)/$1 | fgrep -q '$(ARCH_STRING)' || \
219
- { printf "$1: $(ANSI_RED)Expected $(ARCH_STRING), got $$(file -b $(OUTPUT_DIR)/$1)$(ANSI_RESET)\n"; exit 1; }
219
+ { printf "%s: $(ANSI_RED)Expected %s, got %s$(ANSI_RESET)\n" "$1" "$(ARCH_STRING)" "$$(file -b $(OUTPUT_DIR)/$1)"; exit 1; }
220
220
  endef
221
221
 
222
222
  define check_output
223
- @printf "$1: $(ANSI_GREEN)$3$(ANSI_RESET) / $(ANSI_MAGENTA)$(ARCH_STRING)$(ANSI_RESET)\n"
223
+ @printf "%s: $(ANSI_GREEN)%s$(ANSI_RESET) / $(ANSI_MAGENTA)%s$(ANSI_RESET)\n" "$1" "$3" "$(ARCH_STRING)"
224
224
  endef
225
225
 
226
226
  define check_shlib
@@ -264,13 +264,10 @@ test :
264
264
  $(call check_bin,optipng,--version,$(OPTIPNG_VER))
265
265
  $(call check_bin,oxipng,--version,$(OXIPNG_VER))
266
266
  $(call check_bin,pngcrush,-version 2>&1,$(PNGCRUSH_VER))
267
- $(call check_bin,pngout,2>&1,$(shell perl -mTime::Piece -e 'print Time::Piece->strptime("$(PNGOUT_VER)", "%Y%m%d")->strftime("%b %e %Y")'))
267
+ $(call check_bin,pngout,2>&1 | head -n 1,$(shell perl -mTime::Piece -e 'print Time::Piece->strptime("$(PNGOUT_VER)", "%Y%m%d")->strftime("%b %e %Y")'))
268
268
  $(call check_bin,pngquant,--help,$(PNGQUANT_VER))
269
269
  .PHONY : test
270
270
 
271
- livecheck :; @script/livecheck
272
- .PHONY : livecheck
273
-
274
271
  update-versions :
275
272
  script/livecheck --update
276
273
  make checksum-update
data/README.markdown CHANGED
@@ -1,5 +1,8 @@
1
1
  [![Gem Version](https://img.shields.io/gem/v/image_optim_pack?logo=rubygems)](https://rubygems.org/gems/image_optim_pack)
2
2
  [![Build Status](https://img.shields.io/github/workflow/status/toy/image_optim_pack/check/master?logo=github)](https://github.com/toy/image_optim_pack/actions/workflows/check.yml)
3
+ [![Rubocop](https://img.shields.io/github/workflow/status/toy/image_optim_pack/rubocop/master?label=rubocop&logo=rubocop)](https://github.com/toy/image_optim_pack/actions/workflows/rubocop.yml)
4
+ [![Docker build](https://img.shields.io/github/workflow/status/toy/image_optim_pack/docker-build?label=docker+build&logo=docker)](https://github.com/toy/image_optim_pack/actions/workflows/docker-build.yml)
5
+ [![Livecheck](https://img.shields.io/github/workflow/status/toy/image_optim_pack/livecheck/master?label=livecheck&logo=github)](https://github.com/toy/image_optim_pack/actions/workflows/livecheck.yml)
3
6
  [![Code Climate](https://img.shields.io/codeclimate/maintainability/toy/image_optim_pack?logo=codeclimate)](https://codeclimate.com/github/toy/image_optim_pack)
4
7
  [![Depfu](https://img.shields.io/depfu/toy/image_optim_pack)](https://depfu.com/github/toy/image_optim_pack)
5
8
  [![Inch CI](https://inch-ci.org/github/toy/image_optim_pack.svg?branch=master)](https://inch-ci.org/github/toy/image_optim_pack)
@@ -10,7 +13,7 @@ Precompiled binaries for [`image_optim`](https://github.com/toy/image_optim).
10
13
 
11
14
  Contains binaries for Mac OS X (>= 10.9, x86\_64) and Linux (i686 and x86\_64).
12
15
 
13
- A test application with latest `image_optim` and `image_optim_pack` is available on heroku: https://iopack.herokuapp.com/.
16
+ A test application with latest `image_optim` and `image_optim_pack` is available on render: https://iopack.onrender.com/.
14
17
 
15
18
  ## Binaries and libraries
16
19
 
@@ -80,7 +83,7 @@ script/run darwin 64 # Build only platforms matching darwin or 64
80
83
  make # Build all tools and copy them to vendor/OS-ARCH for current OS and ARCH, then test
81
84
  make all # same
82
85
 
83
- make livecheck # Check versions
86
+ script/livecheck # Check versions
84
87
  make update-versions # Update versions in Makefile
85
88
 
86
89
  make download # Download archives
data/Vagrantfile CHANGED
@@ -46,6 +46,10 @@ Vagrant.configure('2') do |config|
46
46
 
47
47
  apt-get update
48
48
  apt-get -y dist-upgrade
49
+
50
+ if [ $(lsb_release -r | egrep -o '[0-9]+' | head -1) -lt 18 ]; then
51
+ do-release-upgrade -f DistUpgradeViewNonInteractive
52
+ fi
49
53
  else
50
54
  set -ex
51
55
 
data/checksums.mk CHANGED
@@ -5,7 +5,7 @@ JPEGARCHIVE_SHA256 := 3da16a5abbddd925dee0379aa51d9fe0cba33da0b5703be27c13a2dda3
5
5
  JPEGOPTIM_SHA256 := c52616f2fb8d481315871680f9943b0f58c553d1e0c49a6bd4691a3e66d7e6de
6
6
  LIBJPEG_SHA256 := 4077d6a6a75aeb01884f708919d25934c93305e49f7e3f36db9129320e6f4f3d
7
7
  LIBLCMS_SHA256 := 0c67a5cc144029cfa34647a52809ec399aae488db4258a6a66fba318474a070f
8
- LIBMOZJPEG_SHA256 := 4f22731db2afa14531a5bf2633d8af79ca5cb697a550f678bf43f24e5e409ef0
8
+ LIBMOZJPEG_SHA256 := 66b1b8d6b55d263f35f27f55acaaa3234df2a401232de99b6d099e2bb0a9d196
9
9
  LIBPNG_SHA256 := daeb2620d829575513e35fecc83f0d3791a620b9b93d800b763542ece9390fb4
10
10
  LIBZ_SHA256 := c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
11
11
  OPTIPNG_SHA256 := 4f32f233cef870b3f95d3ad6428bfe4224ef34908f1b42b0badf858216654452
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'image_optim_pack'
5
- s.version = '0.9.0'
5
+ s.version = '0.9.1'
6
6
  s.summary = %q{Precompiled binaries for image_optim: advpng, gifsicle, jhead, jpeg-recompress, jpegoptim, jpegtran, optipng, pngcrush, pngquant}
7
7
  s.homepage = "https://github.com/toy/#{s.name}"
8
8
  s.authors = ['Ivan Kuchin']
data/script/livecheck CHANGED
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'yaml'
5
4
  require 'uri'
6
5
  require 'net/http'
7
6
  require 'openssl'
@@ -10,6 +9,69 @@ require 'fspath'
10
9
 
11
10
  # Fetch and compare latest tool/library versions
12
11
  class Livecheck
12
+ CONFIG = {
13
+ advancecomp: {
14
+ url: 'https://github.com/amadvance/advancecomp/releases.atom',
15
+ regexp: %r{<id>tag:github.com,2008:Repository/\d+/\D+?(\d+(?:\.\d+)*)</id>},
16
+ },
17
+ gifsicle: {
18
+ url: 'https://www.lcdf.org/gifsicle/',
19
+ regexp: /gifsicle-(\d+(?:\.\d+)*)\.tar\.gz/,
20
+ },
21
+ jhead: {
22
+ url: 'https://www.sentex.ca/~mwandel/jhead/',
23
+ regexp: /jhead-(\d+(?:\.\d+)*)/,
24
+ },
25
+ jpegoptim: {
26
+ url: 'https://github.com/tjko/jpegoptim/tags.atom',
27
+ regexp: %r{<id>tag:github.com,2008:Repository/\d+/\D+?(\d+(?:\.\d+)*)</id>},
28
+ },
29
+ jpegarchive: {
30
+ url: 'https://github.com/danielgtaylor/jpeg-archive/releases.atom',
31
+ regexp: %r{<id>tag:github.com,2008:Repository/\d+/\D+?(\d+(?:\.\d+)*)</id>},
32
+ },
33
+ libjpeg: {
34
+ url: 'https://www.ijg.org/files/',
35
+ regexp: /jpegsrc.v(.*?).tar.gz/,
36
+ },
37
+ liblcms: {
38
+ url: 'https://sourceforge.net/projects/lcms/rss?path=/lcms',
39
+ regexp: %r{/lcms/(\d+(?:\.\d+)*)/},
40
+ },
41
+ libmozjpeg: {
42
+ url: 'https://github.com/mozilla/mozjpeg/releases.atom',
43
+ regexp: %r{<id>tag:github.com,2008:Repository/\d+/\D+?(\d+(?:\.\d+)*)</id>},
44
+ },
45
+ libpng: {
46
+ url: 'https://sourceforge.net/projects/libpng/rss?path=/libpng16',
47
+ regexp: %r{/libpng\d*/(\d+(?:\.\d+)*)/},
48
+ },
49
+ libz: {
50
+ url: 'https://sourceforge.net/projects/libpng/rss?path=/zlib',
51
+ regexp: %r{/zlib/(\d+(?:\.\d+)*)/},
52
+ },
53
+ optipng: {
54
+ url: 'https://sourceforge.net/projects/optipng/rss',
55
+ regexp: %r{/OptiPNG/optipng-(\d+(?:\.\d+)*)/},
56
+ },
57
+ oxipng: {
58
+ url: 'https://github.com/shssoichiro/oxipng/releases.atom',
59
+ regexp: %r{<id>tag:github.com,2008:Repository/\d+/v(\d+(?:\.\d+)*)</id>},
60
+ },
61
+ pngcrush: {
62
+ url: 'https://sourceforge.net/projects/pmt/rss?path=/pngcrush',
63
+ regexp: %r{/pngcrush/(\d+(?:\.\d+)*)/},
64
+ },
65
+ pngout: {
66
+ url: 'http://www.jonof.id.au/kenutils.html',
67
+ regexp: %r{/files/kenutils/pngout-(\d{8})-linux.tar.gz},
68
+ },
69
+ pngquant: {
70
+ url: 'https://pngquant.org/releases.html',
71
+ regexp: %r{<span itemprop='version'>(\d+(?:\.\d+)*)</span>},
72
+ },
73
+ }.freeze
74
+
13
75
  # Commands
14
76
  class Cli
15
77
  VERSION_REGEXP = /^([A-Z]+)_VER *:= *(.*)$/.freeze
@@ -22,11 +84,15 @@ class Livecheck
22
84
  def run
23
85
  dump_changes
24
86
 
25
- return unless @update
26
87
  return unless livechecks.any?(&:changed?)
27
88
 
89
+ exit 1 unless @update
90
+
28
91
  update_changelog
29
92
  update_makefile
93
+ rescue StandardError => e
94
+ warn e
95
+ exit 2
30
96
  end
31
97
 
32
98
  private
@@ -119,8 +185,6 @@ class Livecheck
119
185
  end
120
186
  end
121
187
 
122
- CONFIG = YAML.load(DATA).freeze
123
-
124
188
  attr_reader :name, :current_version
125
189
 
126
190
  def initialize(name, current_version)
@@ -144,7 +208,7 @@ class Livecheck
144
208
  private
145
209
 
146
210
  def config
147
- CONFIG[name] || fail(ArgumentError, "Livecheck for #{name} not defined")
211
+ CONFIG[name.to_sym] || fail(ArgumentError, "Livecheck for #{name} not defined")
148
212
  end
149
213
 
150
214
  def get(url)
@@ -155,9 +219,9 @@ private
155
219
  end
156
220
 
157
221
  def fetch_versions
158
- body = get(config['url'])
222
+ body = get(config[:url])
159
223
 
160
- version_regex = Regexp.new(config['regexp'])
224
+ version_regex = config[:regexp]
161
225
 
162
226
  versions = body.scan(version_regex).map{ |match| Version.new(*match) }.sort
163
227
  fail "No versions found for #{name} in body:\n#{body}" if versions.empty?
@@ -167,50 +231,3 @@ private
167
231
  end
168
232
 
169
233
  Livecheck::Cli.new(ARGV).run
170
-
171
- __END__
172
- advancecomp:
173
- url: https://github.com/amadvance/advancecomp/releases.atom
174
- regexp: <id>tag:github.com,2008:Repository/\d+/\D+?(\d+(?:\.\d+)*)</id>
175
- gifsicle:
176
- url: https://www.lcdf.org/gifsicle/
177
- regexp: gifsicle-(\d+(?:\.\d+)*)\.tar\.gz
178
- jhead:
179
- url: https://www.sentex.ca/~mwandel/jhead/
180
- regexp: jhead-(\d+(?:\.\d+)*)
181
- jpegoptim:
182
- url: https://github.com/tjko/jpegoptim/tags.atom
183
- regexp: <id>tag:github.com,2008:Repository/\d+/\D+?(\d+(?:\.\d+)*)</id>
184
- jpegarchive:
185
- url: https://github.com/danielgtaylor/jpeg-archive/releases.atom
186
- regexp: <id>tag:github.com,2008:Repository/\d+/\D+?(\d+(?:\.\d+)*)</id>
187
- libjpeg:
188
- url: https://www.ijg.org/files/
189
- regexp: jpegsrc.v(.*?).tar.gz
190
- liblcms:
191
- url: https://sourceforge.net/projects/lcms/rss?path=/lcms
192
- regexp: /lcms/(\d+(?:\.\d+)*)/
193
- libmozjpeg:
194
- url: https://github.com/mozilla/mozjpeg/releases.atom
195
- regexp: <id>tag:github.com,2008:Repository/\d+/\D+?(\d+(?:\.\d+)*)</id>
196
- libpng:
197
- url: https://sourceforge.net/projects/libpng/rss?path=/libpng16
198
- regexp: /libpng\d*/(\d+(?:\.\d+)*)/
199
- libz:
200
- url: https://sourceforge.net/projects/libpng/rss?path=/zlib
201
- regexp: /zlib/(\d+(?:\.\d+)*)/
202
- optipng:
203
- url: https://sourceforge.net/projects/optipng/rss
204
- regexp: /OptiPNG/optipng-(\d+(?:\.\d+)*)/
205
- oxipng:
206
- url: https://github.com/shssoichiro/oxipng/releases.atom
207
- regexp: <id>tag:github.com,2008:Repository/\d+/v(\d+(?:\.\d+)*)</id>
208
- pngcrush:
209
- url: https://sourceforge.net/projects/pmt/rss?path=/pngcrush
210
- regexp: /pngcrush/(\d+(?:\.\d+)*)/
211
- pngout:
212
- url: http://www.jonof.id.au/kenutils.html
213
- regexp: /files/kenutils/pngout-(\d{8})-linux.tar.gz
214
- pngquant:
215
- url: https://pngquant.org/releases.html
216
- regexp: <span itemprop='version'>(\d+(?:\.\d+)*)</span>
data/script/run CHANGED
@@ -57,7 +57,9 @@ for vm in $(perl -pe "s/.*?'(.+?-.+?)'\s+=>\s+'.+?\/.+?'.*|.*/\$1/" Vagrantfile
57
57
  passes-filter "$vm" || continue
58
58
  header "$vm"
59
59
 
60
- [[ -n "$NO_UP" ]] || vagrant up "$vm"
60
+ if [[ -z "$NO_UP" ]]; then
61
+ vagrant status "$vm" | grep -q running || vagrant up "$vm"
62
+ fi
61
63
 
62
64
  # create ssh config
63
65
  ssh_config=".vagrant/ssh_config.$vm"
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: image_optim_pack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Kuchin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-11 00:00:00.000000000 Z
11
+ date: 2022-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: image_optim
@@ -101,6 +101,7 @@ files:
101
101
  - ".dockerignore"
102
102
  - ".github/workflows/check.yml"
103
103
  - ".github/workflows/docker-build.yml"
104
+ - ".github/workflows/livecheck.yml"
104
105
  - ".github/workflows/rubocop.yml"
105
106
  - ".gitignore"
106
107
  - ".rubocop.yml"
@@ -209,7 +210,7 @@ licenses:
209
210
  metadata:
210
211
  bug_tracker_uri: https://github.com/toy/image_optim_pack/issues
211
212
  changelog_uri: https://github.com/toy/image_optim_pack/blob/master/CHANGELOG.markdown
212
- documentation_uri: https://www.rubydoc.info/gems/image_optim_pack/0.9.0
213
+ documentation_uri: https://www.rubydoc.info/gems/image_optim_pack/0.9.1
213
214
  source_code_uri: https://github.com/toy/image_optim_pack
214
215
  post_install_message:
215
216
  rdoc_options: []