-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dcb4c29
commit 95eecef
Showing
74 changed files
with
14,870 additions
and
14 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,167 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'rapidyenc/**' | ||
- '.github/workflows/build.yml' | ||
|
||
jobs: | ||
build_macos: | ||
name: Build macOS | ||
runs-on: macos-13 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build | ||
run: | | ||
export ZERO_AR_DATE=1 | ||
cmake -S rapidyenc -B rapidyenc/build \ | ||
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \ | ||
-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 \ | ||
-DCMAKE_C_COMPILER=/Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc \ | ||
-DCMAKE_CXX_COMPILER=/Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ \ | ||
-DCMAKE_AR=/Applications/Xcode_15.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar | ||
cmake --build rapidyenc/build --target rapidyenc_static -j$(sysctl -n hw.ncpu) | ||
cp rapidyenc/build/rapidyenc_static/librapidyenc.a librapidyenc_darwin.a | ||
- name: Upload static library | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: static | ||
path: librapidyenc_darwin.a | ||
|
||
build_windows: | ||
name: Build Windows x64 | ||
runs-on: windows-latest | ||
|
||
defaults: | ||
run: | ||
shell: msys2 {0} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: MINGW64 | ||
update: true | ||
pacboy: >- | ||
gcc:p | ||
cmake:p | ||
ninja:p | ||
- name: Build | ||
run: | | ||
cmake -S rapidyenc -B rapidyenc/build -G Ninja | ||
cmake --build rapidyenc/build --config Release --target rapidyenc_static | ||
cp rapidyenc/build/rapidyenc_static/librapidyenc.a librapidyenc_windows_amd64.a | ||
- name: Upload shared library | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: static | ||
path: librapidyenc_windows_amd64.a | ||
|
||
build_linux: | ||
name: Build ${{ matrix.platform }} | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
- platform: linux/amd64 | ||
library: librapidyenc_linux_amd64.a | ||
- platform: linux/arm64 | ||
library: librapidyenc_linux_arm64.a | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
if: matrix.platform == 'linux/arm64' | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build cross-compilation environment | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
tags: builder/${{ matrix.platform }}:latest | ||
platforms: ${{ matrix.platform }} | ||
load: true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
push: false | ||
|
||
- name: Build with Docker | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: builder/${{ matrix.platform }}:latest | ||
options: | | ||
--platform ${{ matrix.platform }} | ||
--volume ${{ github.workspace }}:/workspace | ||
--workdir /workspace | ||
run: | | ||
cmake -S rapidyenc -B rapidyenc/build \ | ||
-D CMAKE_BUILD_TYPE=Release | ||
cmake --build rapidyenc/build --target rapidyenc_static -j$(sysctl -n hw.ncpu) | ||
cp rapidyenc/build/rapidyenc_static/librapidyenc.a ${{ matrix.library }} | ||
- name: Upload static library | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: static | ||
path: ${{ matrix.library }} | ||
|
||
test: | ||
name: Test ${{ matrix.os }} go/${{ matrix.go }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
go: [1.21] | ||
runs-on: ${{ matrix.os }} | ||
needs: [build_linux, build_macos, build_windows] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install Go ${{ matrix.go }} | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: static | ||
path: lib | ||
- name: Run tests | ||
run: go test -v | ||
|
||
publish: | ||
name: Publish rapidyenc build | ||
runs-on: ubuntu-latest | ||
|
||
needs: [test] | ||
|
||
permissions: | ||
# Give the default GITHUB_TOKEN write permission to commit and push the | ||
# added or changed files to the repository. | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: static | ||
- uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
file_pattern: '*.a' | ||
commit_message: Built rapidyenc |
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 @@ | ||
rapidyenc/build |
This file was deleted.
Oops, something went wrong.
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,5 @@ | ||
FROM gcc:13 AS cross | ||
|
||
ARG TARGETPLATFORM | ||
|
||
RUN apt-get update && apt-get install -y cmake |
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
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Submodule rapidyenc
deleted from
9c6f0b
Oops, something went wrong.