Skip to content

Commit 5c70a1b

Browse files
committed
amc 1.5.0 -> 1.7.0, use upstream pango, use latest runners
See: #33 I've also fixed the warnings shown by 'brew style', and updated the GitHub Actions using the command: brew tap-new maelvls/foo --github-packages
1 parent 8c909e1 commit 5c70a1b

File tree

4 files changed

+53
-135
lines changed

4 files changed

+53
-135
lines changed

.github/workflows/publish.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,45 @@
11
name: brew pr-pull
2+
23
on:
34
pull_request_target:
45
types:
56
- labeled
7+
68
jobs:
79
pr-pull:
810
if: contains(github.event.pull_request.labels.*.name, 'pr-pull')
9-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-24.04
12+
permissions:
13+
actions: read
14+
checks: read
15+
contents: write
16+
issues: read
17+
packages: write
18+
pull-requests: write
1019
steps:
1120
- name: Set up Homebrew
1221
uses: Homebrew/actions/setup-homebrew@master
22+
with:
23+
token: ${{ github.token }}
1324

1425
- name: Set up git
1526
uses: Homebrew/actions/git-user-config@master
1627

1728
- name: Pull bottles
1829
env:
1930
HOMEBREW_GITHUB_API_TOKEN: ${{ github.token }}
31+
HOMEBREW_GITHUB_PACKAGES_TOKEN: ${{ github.token }}
32+
HOMEBREW_GITHUB_PACKAGES_USER: ${{ github.repository_owner }}
2033
PULL_REQUEST: ${{ github.event.pull_request.number }}
21-
run: brew pr-pull --debug --tap=$GITHUB_REPOSITORY $PULL_REQUEST
34+
run: brew pr-pull --debug --tap="$GITHUB_REPOSITORY" "$PULL_REQUEST"
2235

2336
- name: Push commits
2437
uses: Homebrew/actions/git-try-push@master
2538
with:
26-
token: ${{ github.token }}
2739
branch: main
2840

2941
- name: Delete branch
3042
if: github.event.pull_request.head.repo.fork == false
3143
env:
3244
BRANCH: ${{ github.event.pull_request.head.ref }}
33-
run: git push --delete origin $BRANCH
45+
run: git push --delete origin "$BRANCH"

.github/workflows/tests.yml

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,59 @@
11
name: brew test-bot
2+
23
on:
34
push:
45
branches:
56
- main
67
pull_request:
8+
79
jobs:
810
test-bot:
911
strategy:
1012
matrix:
11-
os:
12-
# auto-multiple-choice: Re-enable Linux as soon as the qt@5 formula
13-
# gets a bootle: https://github.com/Homebrew/linuxbrew-core/pull/23174
14-
#
15-
# amc-pango: installation fails on linux with the error:
16-
# /usr/bin/ld: cannot find -lintl
17-
# collect2: error: ld returned 1 exit status
18-
# Remember to re-enable it one day.
19-
#
20-
# - ubuntu-latest
21-
22-
# https://github.com/actions/virtual-environments/#available-environments
23-
- macos-11
24-
- macos-10.15
13+
os: [ubuntu-24.04, macos-14, macos-15]
2514
runs-on: ${{ matrix.os }}
15+
permissions:
16+
actions: read
17+
checks: read
18+
contents: read
19+
packages: read
20+
pull-requests: read
2621
steps:
2722
- name: Set up Homebrew
2823
id: set-up-homebrew
2924
uses: Homebrew/actions/setup-homebrew@master
25+
with:
26+
token: ${{ github.token }}
3027

3128
- name: Cache Homebrew Bundler RubyGems
32-
id: cache
33-
uses: actions/cache@v1
29+
uses: actions/cache@v4
3430
with:
3531
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
36-
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
37-
restore-keys: ${{ runner.os }}-rubygems-
38-
39-
- name: Install Homebrew Bundler RubyGems
40-
if: steps.cache.outputs.cache-hit != 'true'
41-
run: brew install-bundler-gems
32+
key: ${{ matrix.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
33+
restore-keys: ${{ matrix.os }}-rubygems-
4234

4335
- run: brew test-bot --only-cleanup-before
4436

4537
- run: brew test-bot --only-setup
4638

4739
- run: brew test-bot --only-tap-syntax
48-
49-
- run: brew test-bot --only-formulae
40+
- name: Base64-encode GITHUB_TOKEN for HOMEBREW_DOCKER_REGISTRY_TOKEN
41+
id: base64-encode
42+
if: github.event_name == 'pull_request'
43+
env:
44+
TOKEN: ${{ github.token }}
45+
run: |
46+
base64_token=$(echo -n "${TOKEN}" | base64 | tr -d "\n")
47+
echo "::add-mask::${base64_token}"
48+
echo "token=${base64_token}" >> "${GITHUB_OUTPUT}"
49+
- run: brew test-bot --only-formulae --root-url='https://ghcr.io/v2/${{ github.repository }}'
5050
if: github.event_name == 'pull_request'
51+
env:
52+
HOMEBREW_DOCKER_REGISTRY_TOKEN: ${{ steps.base64-encode.outputs.token }}
5153

5254
- name: Upload bottles as artifact
5355
if: always() && github.event_name == 'pull_request'
54-
uses: actions/upload-artifact@main
56+
uses: actions/upload-artifact@v4
5557
with:
56-
name: bottles
58+
name: bottles_${{ matrix.os }}
5759
path: "*.bottle.*"
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
class AutoMultipleChoice < Formula
22
desc "Printable tests for students with OCR marking"
33
homepage "https://www.auto-multiple-choice.net"
4-
url "https://gitlab.com/jojo_boulix/auto-multiple-choice/uploads/3262cbab3161e5e63239a281e9a2ce23/auto-multiple-choice_1.5.0_dist.tar.gz"
5-
sha256 "2e48ebb11a215c7882212c46f31d9013bb488c32899104008b0840e67f716948"
6-
revision 0
4+
url "https://download.auto-multiple-choice.net/amc_1.7.0_dist.tar.gz"
5+
sha256 "dfb916aa076f668a6f35253a2c0fc5998db07d2273deb45295a405d8749b7660"
76

87
bottle do
98
root_url "https://github.com/maelvls/homebrew-amc/releases/download/auto-multiple-choice-1.5.0"
@@ -25,19 +24,21 @@ class AutoMultipleChoice < Formula
2524
depends_on "librsvg" => :build
2625
depends_on "make" => :build # macOS system make (3.81) breaks vars-subs.pl
2726
depends_on "adwaita-icon-theme"
28-
depends_on "amc-pango"
2927
depends_on "cairo"
28+
depends_on "expat"
3029
depends_on "freetype"
3130
depends_on "gettext"
3231
depends_on "glib"
3332
depends_on "gobject-introspection"
3433
depends_on "gtk+3"
34+
depends_on "harfbuzz"
3535
depends_on "imagemagick@6"
3636
depends_on "libffi"
3737
depends_on "libx11"
3838
depends_on "netpbm"
39-
depends_on "opencv" # vendored Pango, stuck at v1.42.4
39+
depends_on "opencv"
4040
depends_on "openssl@3" # required by Net::SSLeay
41+
depends_on "pango"
4142
depends_on "perl"
4243
depends_on "poppler"
4344
depends_on "qpdf"
@@ -451,7 +452,7 @@ def install
451452
ENV.prepend_path "PATH", Formula["gobject-introspection"].bin
452453
ENV.prepend_path "PKG_CONFIG_PATH", "#{Formula["libffi"].lib}/pkgconfig" # for Glib::Object::Introspection
453454
ENV.prepend_path "PKG_CONFIG_PATH", "#{Formula["gobject-introspection"].lib}/pkgconfig" # Same
454-
ENV.prepend_path "PKG_CONFIG_PATH", "#{Formula["amc-pango"].lib}/pkgconfig" # for Pango & AMC-buildpdf
455+
ENV.prepend_path "PKG_CONFIG_PATH", "#{Formula["pango"].lib}/pkgconfig" # for Pango & AMC-buildpdf
455456

456457
ENV["OPENSSL_PREFIX"] = Formula["openssl@3"].prefix.to_s
457458
ENV["PERL_MM_OPT"] = "INSTALL_BASE=#{libexec}" # for cpan (Makefile.PL)
@@ -502,8 +503,8 @@ def install
502503
(bin/"auto-multiple-choice").write_env_script libexec/"bin/auto-multiple-choice",
503504
PERL5LIB: ENV["PERL5LIB"],
504505
# netpbm, poppler and imagemagick@6 must be in the PATH
505-
PATH: "#{libexec}/bin:#{Formula["qpdf"].bin}:#{Formula["netpbm"].bin}"\
506-
":#{Formula["poppler"].bin}:#{Formula["imagemagick@6"].bin}"\
506+
PATH: "#{libexec}/bin:#{Formula["qpdf"].bin}:#{Formula["netpbm"].bin}" \
507+
":#{Formula["poppler"].bin}:#{Formula["imagemagick@6"].bin}" \
507508
":#{Formula["gobject-introspection"].bin}:$PATH",
508509
AMCBASEDIR: prefix
509510

amc-pango.rb

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)