Skip to content

Commit

Permalink
Docker changes
Browse files Browse the repository at this point in the history
  • Loading branch information
KnowItAllKing committed Jun 14, 2024
1 parent 8563ec7 commit f45b0de
Showing 1 changed file with 18 additions and 22 deletions.
40 changes: 18 additions & 22 deletions .github/workflows/prebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
strategy:
matrix:
node: [18.12.0, 20.9.0]
canvas_tag: ["v2.11.2"] # e.g. "v2.6.1"
canvas_tag: ["v2.11.2"] # Specify the canvas tag to build
name: ${{ matrix.canvas_tag }}, Node.js ${{ matrix.node }}, Linux
runs-on: ubuntu-latest
container:
image: chearon/canvas-prebuilt:7
image: node:${{ matrix.node }}-slim
env:
CANVAS_VERSION_TO_BUILD: ${{ matrix.canvas_tag }}
steps:
Expand All @@ -28,24 +28,29 @@ jobs:
with:
node-version: ${{ matrix.node }}

- name: Build
- name: Install dependencies
run: |
apt-get update && apt-get install -y \
build-essential \
libcairo2-dev \
libpango1.0-dev \
libjpeg-dev \
libgif-dev \
librsvg2-dev \
pkg-config \
python3
npm install -g node-gyp
npm install --ignore-scripts
- name: Build
run: |
. prebuild/Linux/preinstall.sh
cp prebuild/Linux/binding.gyp binding.gyp
node-gyp rebuild -j 2
. prebuild/Linux/bundle.sh
- name: Test binary
run: |
cd /root/harfbuzz-* && make uninstall
cd /root/cairo-* && make uninstall
cd /root/pango-* && make uninstall
cd /root/libpng-* && make uninstall
cd /root/libjpeg-* && make uninstall
cd /root/giflib-* && make uninstall
cd $GITHUB_WORKSPACE && npm test
run: npm test

- name: Make bundle
id: make_bundle
Expand All @@ -59,16 +64,13 @@ jobs:
const assetName = "${{ steps.make_bundle.outputs.asset_name }}";
const tagName = process.env.UPLOAD_TO || process.env.CANVAS_VERSION_TO_BUILD;
const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
const releases = await github.repos.listReleases({ owner, repo });
const release = releases.data.find(r => r.tag_name === tagName);
if (!release)
throw new Error(`Tag ${tagName} not found. Did you make the GitHub release?`);
const oldAsset = release.assets.find(a => a.name === assetName);
if (oldAsset)
await github.repos.deleteReleaseAsset({ owner, repo, asset_id: oldAsset.id });
// (This is equivalent to actions/upload-release-asset. We're
// already in a script, so might as well do it here.)
const r = await github.repos.uploadReleaseAsset({
Expand All @@ -85,7 +87,7 @@ jobs:
strategy:
matrix:
node: [18.12.0, 20.9.0]
canvas_tag: ["v2.11.2"] # e.g. "v2.6.1"
canvas_tag: ["v2.11.2"] # Specify the canvas tag to build
os: [x64, arm64]
name: ${{ matrix.canvas_tag }}, Node.js ${{ matrix.node }}, macOS ${{ matrix.os }}
runs-on: ${{ matrix.os == 'arm64' && 'macos-latest-xlarge' || 'macos-latest' }}
Expand Down Expand Up @@ -126,16 +128,13 @@ jobs:
const assetName = "${{ steps.make_bundle.outputs.asset_name }}";
const tagName = process.env.UPLOAD_TO || process.env.CANVAS_VERSION_TO_BUILD;
const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
const releases = await github.repos.listReleases({ owner, repo });
const release = releases.data.find(r => r.tag_name === tagName);
if (!release)
throw new Error(`Tag ${tagName} not found. Did you make the GitHub release?`);
const oldAsset = release.assets.find(a => a.name === assetName);
if (oldAsset)
await github.repos.deleteReleaseAsset({ owner, repo, asset_id: oldAsset.id });
// (This is equivalent to actions/upload-release-asset. We're
// already in a script, so might as well do it here.)
const r = await github.repos.uploadReleaseAsset({
Expand All @@ -152,7 +151,7 @@ jobs:
strategy:
matrix:
node: [18.12.0, 20.9.0]
canvas_tag: ["v2.11.2"] # e.g. "v2.6.1"
canvas_tag: ["v2.11.2"] # Specify the canvas tag to build
name: ${{ matrix.canvas_tag }}, Node.js ${{ matrix.node }}, Windows
runs-on: windows-latest
env:
Expand Down Expand Up @@ -201,16 +200,13 @@ jobs:
const assetName = "${{ steps.make_bundle.outputs.asset_name }}";
const tagName = process.env.UPLOAD_TO || process.env.CANVAS_VERSION_TO_BUILD;
const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
const releases = await github.repos.listReleases({ owner, repo });
const release = releases.data.find(r => r.tag_name === tagName);
if (!release)
throw new Error(`Tag ${tagName} not found. Did you make the GitHub release?`);
const oldAsset = release.assets.find(a => a.name === assetName);
if (oldAsset)
await github.repos.deleteReleaseAsset({ owner, repo, asset_id: oldAsset.id });
// (This is equivalent to actions/upload-release-asset. We're
// already in a script, so might as well do it here.)
const r = await github.repos.uploadReleaseAsset({
Expand Down

0 comments on commit f45b0de

Please sign in to comment.