Skip to content

Commit 79f16d9

Browse files
committed
try macos fix
1 parent a287ad1 commit 79f16d9

File tree

1 file changed

+191
-191
lines changed

1 file changed

+191
-191
lines changed

.github/workflows/prebuild.yaml

Lines changed: 191 additions & 191 deletions
Original file line numberDiff line numberDiff line change
@@ -46,97 +46,97 @@ on: workflow_dispatch
4646
# Manually set this file depending on what you're building!!
4747

4848
jobs:
49-
Linux:
50-
strategy:
51-
fail-fast: false
52-
matrix:
53-
node: [21]
54-
canvas_tag: ["v3.0.0-rc2"] # e.g. "v2.6.1"
55-
name: ${{ matrix.canvas_tag }}, Node.js ${{ matrix.node }}, Linux
56-
runs-on: ubuntu-latest
57-
container:
58-
image: ${{ matrix.node < 18 && 'chearon/canvas-prebuilt:9' || 'zbbjornson/canvas-prebuilt:11' }}
59-
env:
60-
CANVAS_VERSION_TO_BUILD: ${{ matrix.canvas_tag }}
61-
steps:
62-
- uses: actions/checkout@v2
63-
with:
64-
ref: ${{ matrix.canvas_tag }}
65-
66-
# Use the files in the prebuild/ directory from the commit that was used
67-
# to trigger the prebuild workflow. The version of git that's installed on
68-
# this Linux here doesn't support the method used on Mac and Win, so we
69-
# checkout the prebuild branch and copy the files from the prebuild/
70-
# directory in the Build step.
71-
- uses: actions/checkout@v2
72-
with:
73-
ref: ${{ env.GITHUB_SHA }}
74-
path: prebuild-branch
75-
76-
- uses: actions/setup-node@v1
77-
with:
78-
node-version: ${{ matrix.node }}
79-
80-
- name: Build
81-
run: |
82-
set -ex
83-
mkdir -p prebuild
84-
cp -rfv ./prebuild-branch/prebuild/* ./prebuild/
85-
npm install -g node-gyp
86-
npm install --ignore-scripts
87-
cp prebuild/Linux/binding.gyp binding.gyp
88-
node-gyp rebuild -j 2
89-
. prebuild/Linux/bundle.sh
90-
91-
- name: Test binary
92-
continue-on-error: true
93-
run: |
94-
set -ex
95-
cd /root/harfbuzz-* && make uninstall
96-
cd /root/cairo-* && make uninstall
97-
cd /root/pango-* && cd _build && ninja uninstall
98-
cd /root/libpng-* && make uninstall
99-
cd /root/libjpeg-* && cd b && make uninstall
100-
cd /root/giflib-* && make uninstall
101-
102-
cd $GITHUB_WORKSPACE
103-
ls build/Release
104-
ldd build/Release/canvas.node
105-
npx mocha test/*.test.js
106-
107-
- name: Make bundle
108-
id: make_bundle
109-
run: . prebuild/tarball.sh
110-
111-
- name: Upload
112-
uses: actions/github-script@v2
113-
with:
114-
script: |
115-
const fs = require("fs");
116-
const assetName = "${{ steps.make_bundle.outputs.asset_name }}";
117-
const tagName = process.env.UPLOAD_TO || process.env.CANVAS_VERSION_TO_BUILD;
118-
const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
119-
120-
const releases = await github.repos.listReleases({owner, repo});
121-
const release = releases.data.find(r => r.tag_name === tagName);
122-
if (!release)
123-
throw new Error(`Tag ${tagName} not found. Did you make the GitHub release?`);
124-
125-
const oldAsset = release.assets.find(a => a.name === assetName);
126-
if (oldAsset)
127-
await github.repos.deleteReleaseAsset({owner, repo, asset_id: oldAsset.id});
128-
129-
// (This is equivalent to actions/upload-release-asset. We're
130-
// already in a script, so might as well do it here.)
131-
const r = await github.repos.uploadReleaseAsset({
132-
url: release.upload_url,
133-
headers: {
134-
"content-type": "application/x-gzip",
135-
"content-length": `${fs.statSync(assetName).size}`
136-
},
137-
name: assetName,
138-
data: fs.readFileSync(assetName)
139-
});
49+
# Linux:
50+
# strategy:
51+
# fail-fast: false
52+
# matrix:
53+
# node: [21]
54+
# canvas_tag: ["v3.0.0-rc2"] # e.g. "v2.6.1"
55+
# name: ${{ matrix.canvas_tag }}, Node.js ${{ matrix.node }}, Linux
56+
# runs-on: ubuntu-latest
57+
# container:
58+
# image: ${{ matrix.node < 18 && 'chearon/canvas-prebuilt:9' || 'zbbjornson/canvas-prebuilt:11' }}
59+
# env:
60+
# CANVAS_VERSION_TO_BUILD: ${{ matrix.canvas_tag }}
61+
# steps:
62+
# - uses: actions/checkout@v2
63+
# with:
64+
# ref: ${{ matrix.canvas_tag }}
65+
66+
# # Use the files in the prebuild/ directory from the commit that was used
67+
# # to trigger the prebuild workflow. The version of git that's installed on
68+
# # this Linux here doesn't support the method used on Mac and Win, so we
69+
# # checkout the prebuild branch and copy the files from the prebuild/
70+
# # directory in the Build step.
71+
# - uses: actions/checkout@v2
72+
# with:
73+
# ref: ${{ env.GITHUB_SHA }}
74+
# path: prebuild-branch
75+
76+
# - uses: actions/setup-node@v1
77+
# with:
78+
# node-version: ${{ matrix.node }}
79+
80+
# - name: Build
81+
# run: |
82+
# set -ex
83+
# mkdir -p prebuild
84+
# cp -rfv ./prebuild-branch/prebuild/* ./prebuild/
85+
# npm install -g node-gyp
86+
# npm install --ignore-scripts
87+
# cp prebuild/Linux/binding.gyp binding.gyp
88+
# node-gyp rebuild -j 2
89+
# . prebuild/Linux/bundle.sh
90+
91+
# - name: Test binary
92+
# continue-on-error: true
93+
# run: |
94+
# set -ex
95+
# cd /root/harfbuzz-* && make uninstall
96+
# cd /root/cairo-* && make uninstall
97+
# cd /root/pango-* && cd _build && ninja uninstall
98+
# cd /root/libpng-* && make uninstall
99+
# cd /root/libjpeg-* && cd b && make uninstall
100+
# cd /root/giflib-* && make uninstall
101+
102+
# cd $GITHUB_WORKSPACE
103+
# ls build/Release
104+
# ldd build/Release/canvas.node
105+
# npx mocha test/*.test.js
106+
107+
# - name: Make bundle
108+
# id: make_bundle
109+
# run: . prebuild/tarball.sh
110+
111+
# - name: Upload
112+
# uses: actions/github-script@v2
113+
# with:
114+
# script: |
115+
# const fs = require("fs");
116+
# const assetName = "${{ steps.make_bundle.outputs.asset_name }}";
117+
# const tagName = process.env.UPLOAD_TO || process.env.CANVAS_VERSION_TO_BUILD;
118+
# const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
119+
120+
# const releases = await github.repos.listReleases({owner, repo});
121+
# const release = releases.data.find(r => r.tag_name === tagName);
122+
# if (!release)
123+
# throw new Error(`Tag ${tagName} not found. Did you make the GitHub release?`);
124+
125+
# const oldAsset = release.assets.find(a => a.name === assetName);
126+
# if (oldAsset)
127+
# await github.repos.deleteReleaseAsset({owner, repo, asset_id: oldAsset.id});
128+
129+
# // (This is equivalent to actions/upload-release-asset. We're
130+
# // already in a script, so might as well do it here.)
131+
# const r = await github.repos.uploadReleaseAsset({
132+
# url: release.upload_url,
133+
# headers: {
134+
# "content-type": "application/x-gzip",
135+
# "content-length": `${fs.statSync(assetName).size}`
136+
# },
137+
# name: assetName,
138+
# data: fs.readFileSync(assetName)
139+
# });
140140

141141
macOS:
142142
strategy:
@@ -211,103 +211,103 @@ jobs:
211211
data: fs.readFileSync(assetName)
212212
});
213213
214-
Win:
215-
strategy:
216-
fail-fast: false
217-
matrix:
218-
node: [21]
219-
canvas_tag: ["v3.0.0-rc2"] # e.g. "v2.6.1"
220-
name: ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, Windows
221-
runs-on: windows-2019
222-
env:
223-
CANVAS_VERSION_TO_BUILD: ${{ matrix.canvas_tag }}
224-
steps:
225-
# GitHub runners now have msys2 installed, but msys is not on the path and
226-
# is apparently slow to start.
227-
# https://github.com/msys2/setup-msys2#setup-msys2
228-
# https://github.com/actions/virtual-environments/pull/632
229-
- uses: msys2/setup-msys2@v2
230-
with:
231-
msystem: UCRT64
232-
update: true
233-
path-type: inherit
234-
235-
- uses: actions/setup-node@v3
236-
with:
237-
node-version: ${{ matrix.node }}
238-
239-
- uses: actions/checkout@v3
240-
with:
241-
ref: ${{ matrix.canvas_tag }}
242-
# Fetch all commits/all branches so we can checkout the prebuild
243-
# branch's files
244-
fetch-depth: 0
245-
246-
- name: Build
247-
run: |
248-
git checkout ${{ matrix.canvas_tag }}
249-
git checkout $env:GITHUB_SHA -- prebuild/
250-
npm install -g node-gyp
251-
npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
252-
npm install --ignore-scripts
253-
msys2 -c ". prebuild/Windows/preinstall.sh"
254-
msys2 -c "cp prebuild/Windows/binding.gyp binding.gyp"
255-
npm install --build-from-source
256-
257-
- name: Install Depends
258-
run: |
259-
Invoke-WebRequest "http://www.dependencywalker.com/depends22_x64.zip" -OutFile depends22_x64.zip
260-
7z e depends22_x64.zip
261-
- name: Bundle pt 2
262-
shell: msys2 {0}
263-
run: |
264-
./depends.exe -c -oc depends.csv build\\Release\\canvas.node || true
265-
[ -f depends.csv ] || { echo "error invoking depends.exe"; exit 1; }
266-
267-
copies=$(comm -12 \
268-
<(cat depends.csv | cut -d ',' -f2 | sed 's/"//g' | tr '[:upper:]' '[:lower:]' | sort) \
269-
<(find /ucrt64/bin -name '*.dll' -printf "%f\n" | tr '[:upper:]' '[:lower:]' | sort) \
270-
)
271-
272-
for dll in $copies; do
273-
cp /ucrt64/bin/$dll build/Release
274-
done;
275-
276-
- name: Test binary
277-
# By not running in msys2, this doesn't have access to the msys2 libs
278-
run: npm test
279-
280-
- name: Make asset
281-
id: make_bundle
282-
# I can't figure out why this isn't an env var already. It shows up with `env`.
283-
run: msys2 -c "UPLOAD_TO=${{ env.UPLOAD_TO }} CANVAS_VERSION_TO_BUILD=${{ env.CANVAS_VERSION_TO_BUILD}} . prebuild/tarball.sh"
284-
285-
- name: Upload
286-
uses: actions/github-script@v2
287-
with:
288-
script: |
289-
const fs = require("fs");
290-
const assetName = "${{ steps.make_bundle.outputs.asset_name }}";
291-
const tagName = process.env.UPLOAD_TO || process.env.CANVAS_VERSION_TO_BUILD;
292-
const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
293-
294-
const releases = await github.repos.listReleases({owner, repo});
295-
const release = releases.data.find(r => r.tag_name === tagName);
296-
if (!release)
297-
throw new Error(`Tag ${tagName} not found. Did you make the GitHub release?`);
298-
299-
const oldAsset = release.assets.find(a => a.name === assetName);
300-
if (oldAsset)
301-
await github.repos.deleteReleaseAsset({owner, repo, asset_id: oldAsset.id});
302-
303-
// (This is equivalent to actions/upload-release-asset. We're
304-
// already in a script, so might as well do it here.)
305-
const r = await github.repos.uploadReleaseAsset({
306-
url: release.upload_url,
307-
headers: {
308-
"content-type": "application/x-gzip",
309-
"content-length": `${fs.statSync(assetName).size}`
310-
},
311-
name: assetName,
312-
data: fs.readFileSync(assetName)
313-
});
214+
# Win:
215+
# strategy:
216+
# fail-fast: false
217+
# matrix:
218+
# node: [21]
219+
# canvas_tag: ["v3.0.0-rc2"] # e.g. "v2.6.1"
220+
# name: ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, Windows
221+
# runs-on: windows-2019
222+
# env:
223+
# CANVAS_VERSION_TO_BUILD: ${{ matrix.canvas_tag }}
224+
# steps:
225+
# # GitHub runners now have msys2 installed, but msys is not on the path and
226+
# # is apparently slow to start.
227+
# # https://github.com/msys2/setup-msys2#setup-msys2
228+
# # https://github.com/actions/virtual-environments/pull/632
229+
# - uses: msys2/setup-msys2@v2
230+
# with:
231+
# msystem: UCRT64
232+
# update: true
233+
# path-type: inherit
234+
235+
# - uses: actions/setup-node@v3
236+
# with:
237+
# node-version: ${{ matrix.node }}
238+
239+
# - uses: actions/checkout@v3
240+
# with:
241+
# ref: ${{ matrix.canvas_tag }}
242+
# # Fetch all commits/all branches so we can checkout the prebuild
243+
# # branch's files
244+
# fetch-depth: 0
245+
246+
# - name: Build
247+
# run: |
248+
# git checkout ${{ matrix.canvas_tag }}
249+
# git checkout $env:GITHUB_SHA -- prebuild/
250+
# npm install -g node-gyp
251+
# npm prefix -g | % {npm config set node_gyp "$_\node_modules\node-gyp\bin\node-gyp.js"}
252+
# npm install --ignore-scripts
253+
# msys2 -c ". prebuild/Windows/preinstall.sh"
254+
# msys2 -c "cp prebuild/Windows/binding.gyp binding.gyp"
255+
# npm install --build-from-source
256+
257+
# - name: Install Depends
258+
# run: |
259+
# Invoke-WebRequest "http://www.dependencywalker.com/depends22_x64.zip" -OutFile depends22_x64.zip
260+
# 7z e depends22_x64.zip
261+
# - name: Bundle pt 2
262+
# shell: msys2 {0}
263+
# run: |
264+
# ./depends.exe -c -oc depends.csv build\\Release\\canvas.node || true
265+
# [ -f depends.csv ] || { echo "error invoking depends.exe"; exit 1; }
266+
267+
# copies=$(comm -12 \
268+
# <(cat depends.csv | cut -d ',' -f2 | sed 's/"//g' | tr '[:upper:]' '[:lower:]' | sort) \
269+
# <(find /ucrt64/bin -name '*.dll' -printf "%f\n" | tr '[:upper:]' '[:lower:]' | sort) \
270+
# )
271+
272+
# for dll in $copies; do
273+
# cp /ucrt64/bin/$dll build/Release
274+
# done;
275+
276+
# - name: Test binary
277+
# # By not running in msys2, this doesn't have access to the msys2 libs
278+
# run: npm test
279+
280+
# - name: Make asset
281+
# id: make_bundle
282+
# # I can't figure out why this isn't an env var already. It shows up with `env`.
283+
# run: msys2 -c "UPLOAD_TO=${{ env.UPLOAD_TO }} CANVAS_VERSION_TO_BUILD=${{ env.CANVAS_VERSION_TO_BUILD}} . prebuild/tarball.sh"
284+
285+
# - name: Upload
286+
# uses: actions/github-script@v2
287+
# with:
288+
# script: |
289+
# const fs = require("fs");
290+
# const assetName = "${{ steps.make_bundle.outputs.asset_name }}";
291+
# const tagName = process.env.UPLOAD_TO || process.env.CANVAS_VERSION_TO_BUILD;
292+
# const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
293+
294+
# const releases = await github.repos.listReleases({owner, repo});
295+
# const release = releases.data.find(r => r.tag_name === tagName);
296+
# if (!release)
297+
# throw new Error(`Tag ${tagName} not found. Did you make the GitHub release?`);
298+
299+
# const oldAsset = release.assets.find(a => a.name === assetName);
300+
# if (oldAsset)
301+
# await github.repos.deleteReleaseAsset({owner, repo, asset_id: oldAsset.id});
302+
303+
# // (This is equivalent to actions/upload-release-asset. We're
304+
# // already in a script, so might as well do it here.)
305+
# const r = await github.repos.uploadReleaseAsset({
306+
# url: release.upload_url,
307+
# headers: {
308+
# "content-type": "application/x-gzip",
309+
# "content-length": `${fs.statSync(assetName).size}`
310+
# },
311+
# name: assetName,
312+
# data: fs.readFileSync(assetName)
313+
# });

0 commit comments

Comments
 (0)