-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish ninja-build static binary for Linux (1/n)
- Loading branch information
Jonah Beckford
committed
Oct 2, 2024
1 parent
78e5b45
commit 72d89ef
Showing
4 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
########################################################################## | ||
# File: dkcoder\.github\workflows\ninja-build-static.yml # | ||
# # | ||
# Copyright 2024 Diskuv, Inc. # | ||
# # | ||
# Licensed under the Open Software License version 3.0 # | ||
# (the "License"); you may not use this file except in compliance # | ||
# with the License. You may obtain a copy of the License at # | ||
# # | ||
# https://opensource.org/license/osl-3-0-php/ # | ||
# # | ||
########################################################################## | ||
|
||
name: Publish ninja-build as a static binary | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
# We aren't use cross-compilation. Instead we have multiple platforms | ||
# with QEMU emulation providing a native environment. An alternative | ||
# is to use CMake to build Ninja with a cross-compiler. | ||
- name: Build and export to Docker | ||
uses: docker/build-push-action@v6 | ||
id: image | ||
with: | ||
#platforms: linux/amd64,linux/arm64,linux/386 | ||
file: ci/ninja-build-static/Dockerfile | ||
outputs: out | ||
|
||
- name: Test inside container | ||
run: docker run --rm ${{ steps.image.outputs.imageid }} ./ninja --version | ||
|
||
- name: Test outside container | ||
run: out/usr/local/src/ninja-build/ninja --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
########################################################################## | ||
# File: dkcoder\ci\ninja-build-static\Dockerfile # | ||
# # | ||
# Copyright 2024 Diskuv, Inc. # | ||
# # | ||
# Licensed under the Open Software License version 3.0 # | ||
# (the "License"); you may not use this file except in compliance # | ||
# with the License. You may obtain a copy of the License at # | ||
# # | ||
# https://opensource.org/license/osl-3-0-php/ # | ||
# # | ||
########################################################################## | ||
|
||
FROM alpine:3.20 | ||
|
||
# Install compiler toolchain and Python | ||
RUN apk update && apk upgrade && apk add coreutils gcc g++ python3 | ||
|
||
# Download v1.12.1 | ||
ADD https://github.com/ninja-build/ninja.git#2daa09ba270b0a43e1929d29b073348aa985dfaa /usr/local/src/ninja-build/ | ||
|
||
# Build Ninja | ||
WORKDIR /usr/local/src/ninja-build | ||
RUN CFLAGS=-static ./configure.py --bootstrap --verbose |