@@ -45,104 +45,104 @@ on: workflow_dispatch
4545# this file depending on what you're building!!
4646
4747jobs :
48- Linux :
49- strategy :
50- fail-fast : false
51- matrix :
52- node : [8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
53- canvas_tag : ["v2.11.1"] # e.g. "v2.6.1"
54- name : ${{ matrix.canvas_tag }}, Node.js ${{ matrix.node }}, Linux
55- runs-on : ubuntu-latest
56- container :
57- image : ${{ matrix.node < 18 && 'chearon/canvas-prebuilt:9' || 'zbbjornson/canvas-prebuilt:10' }}
58- env :
59- CANVAS_VERSION_TO_BUILD : ${{ matrix.canvas_tag }}
60- steps :
61- - uses : actions/checkout@v2
62- with :
63- ref : ${{ matrix.canvas_tag }}
64-
65- # Use the files in the prebuild/ directory from the commit that was used
66- # to trigger the prebuild workflow. The version of git that's installed on
67- # this Linux here doesn't support the method used on Mac and Win, so we
68- # checkout the prebuild branch and copy the files from the prebuild/
69- # directory in the Build step.
70- - uses : actions/checkout@v2
71- with :
72- ref : ${{ env.GITHUB_SHA }}
73- path : prebuild-branch
74-
75- - uses : actions/setup-node@v1
76- with :
77- node-version : ${{ matrix.node }}
78-
79- - name : Build
80- run : |
81- set -ex
82- mkdir -p prebuild
83- cp -rfv ./prebuild-branch/prebuild/* ./prebuild/
84- npm install -g node-gyp@6
85- npm install --ignore-scripts
86- . prebuild/Linux/preinstall.sh
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- });
48+ # Linux:
49+ # strategy:
50+ # fail-fast: false
51+ # matrix:
52+ # node: [8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
53+ # canvas_tag: ["v2.11.1"] # e.g. "v2.6.1"
54+ # name: ${{ matrix.canvas_tag }}, Node.js ${{ matrix.node }}, Linux
55+ # runs-on: ubuntu-latest
56+ # container:
57+ # image: ${{ matrix.node < 18 && 'chearon/canvas-prebuilt:9' || 'zbbjornson/canvas-prebuilt:10' }}
58+ # env:
59+ # CANVAS_VERSION_TO_BUILD: ${{ matrix.canvas_tag }}
60+ # steps:
61+ # - uses: actions/checkout@v2
62+ # with:
63+ # ref: ${{ matrix.canvas_tag }}
64+
65+ # # Use the files in the prebuild/ directory from the commit that was used
66+ # # to trigger the prebuild workflow. The version of git that's installed on
67+ # # this Linux here doesn't support the method used on Mac and Win, so we
68+ # # checkout the prebuild branch and copy the files from the prebuild/
69+ # # directory in the Build step.
70+ # - uses: actions/checkout@v2
71+ # with:
72+ # ref: ${{ env.GITHUB_SHA }}
73+ # path: prebuild-branch
74+
75+ # - uses: actions/setup-node@v1
76+ # with:
77+ # node-version: ${{ matrix.node }}
78+
79+ # - name: Build
80+ # run: |
81+ # set -ex
82+ # mkdir -p prebuild
83+ # cp -rfv ./prebuild-branch/prebuild/* ./prebuild/
84+ # npm install -g node-gyp@6
85+ # npm install --ignore-scripts
86+ # . prebuild/Linux/preinstall.sh
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 :
143143 fail-fast : false
144144 matrix :
145- node : [8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
145+ node : [13, 14, 15, 16, 17, 18, 19]
146146 canvas_tag : ["v2.11.1"] # e.g. "v2.6.1"
147147 name : ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, macOS
148148 runs-on : macos-latest
@@ -165,7 +165,7 @@ jobs:
165165 set -Eeuxo pipefail
166166 git checkout ${{ matrix.canvas_tag }}
167167 git checkout $GITHUB_SHA -- prebuild/
168- npm install -g node-gyp@6
168+ npm install -g node-gyp
169169 npm install --ignore-scripts
170170 . prebuild/macOS/preinstall.sh
171171 cp prebuild/macOS/binding.gyp binding.gyp
@@ -215,7 +215,7 @@ jobs:
215215 strategy :
216216 fail-fast : false
217217 matrix :
218- node : [8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ]
218+ node : [8]
219219 canvas_tag : ["v2.11.1"] # e.g. "v2.6.1"
220220 name : ${{ matrix.canvas_tag}}, Node.js ${{ matrix.node }}, Windows
221221 runs-on : windows-2019
0 commit comments