Improves uploading binaries #16
Workflow file for this run
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
permissions: read-all | |
name: Create release artifacts | |
on: | |
push: | |
tags: | |
- '*' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
cmake_ubuntu_x86_64: | |
name: Build x86_64 | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
include: | |
- name: GCC-12 (C++20) | |
extra_deps: g++-12 | |
c_compiler: gcc-12 | |
cxx_compiler: g++-12 | |
cxx_flags: -ftrapv | |
cxx_standard: 20 | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | |
with: | |
egress-policy: audit # cannot be block - runner does git checkout | |
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.0.0 | |
- name: Install deps | |
run: sudo apt-get install ${{ matrix.extra_deps }} git curl | |
- name: Build Clang x86_64 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
export CMAKE_BUILD_PARALLEL_LEVEL=2 | |
export CTEST_PARALLEL_LEVEL=2 | |
git clone --branch widen_mul https://token:${GITHUB_TOKEN}@github.com/awxkee/highway | |
CXXFLAGS=${{ matrix.cxx_flags }} CC=${{ matrix.c_compiler }} CXX=${{ matrix.cxx_compiler }} cmake -DCMAKE_CXX_STANDARD=${{ matrix.cxx_standard }} -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED=ON -B out . | |
cmake --build out | |
cp ./out/libsparkyuv.so libsparkyuv.so | |
- name: Compress GCC x86_64 build | |
uses: a7ul/tar-action@v1.1.0 | |
id: compress | |
with: | |
command: c | |
files: | | |
libsparkyuv.so | |
include | |
outPath: libsparkyuv.linux-x86_64.tar.gz | |
- name: Upload built library | |
uses: actions/upload-artifact@v4 | |
id: artifact-linux-x86_64 | |
with: | |
name: libsparkyuv.linux-x86_64.tar.gz | |
path: libsparkyuv.linux-x86_64.tar.gz | |
gcc_ubuntu_arm64: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
- arch: aarch64 | |
distro: ubuntu_latest | |
cxx_flags: -Wno-psabi | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build and test | |
uses: uraimo/run-on-arch-action@v2.7.1 | |
id: build | |
with: | |
arch: ${{ matrix.arch }} | |
distro: ${{ matrix.distro }} | |
# Not required, but speeds up builds | |
githubToken: ${{ github.token }} | |
env: | | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
setup: | | |
mkdir -p "${PWD}/artifacts" | |
dockerRunArgs: | | |
--volume "${PWD}/artifacts:/artifacts" | |
install: | | |
apt-get update -q -y | |
apt-get install -q -y --no-install-recommends \ | |
build-essential \ | |
cmake \ | |
ninja-build \ | |
git curl \ | |
; | |
apt-get reinstall -y ca-certificates | |
update-ca-certificates | |
run: | | |
export GIT_SSL_NO_VERIFY=1 | |
git config --global http.sslverify false | |
git clone --branch widen_mul https://token:${GITHUB_TOKEN}@github.com/awxkee/highway | |
export CMAKE_BUILD_PARALLEL_LEVEL=2 | |
export CTEST_PARALLEL_LEVEL=2 | |
CXXFLAGS=${{ matrix.cxx_flags }} cmake -GNinja ${{ matrix.cmake_flags }} -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED=ON -B out . | |
cmake --build out | |
rm -rf libsparkyuv.so | |
cp ./out/libsparkyuv.so libsparkyuv.so | |
tar -cf libsparkyuv.linux-${{ matrix.arch }}.tar.gz libsparkyuv.so include | |
cp libsparkyuv.linux-${{ matrix.arch }}.tar.gz "/artifacts/libsparkyuv.linux-${{ matrix.arch }}.tar.gz" | |
- name: Upload built library | |
uses: actions/upload-artifact@v4 | |
id: artifact-linux-aarch64 | |
with: | |
name: libsparkyuv.linux-aarch64.tar.gz | |
path: libsparkyuv.linux-aarch64.tar.gz | |
create_release: | |
name: Create and upload release | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
needs: | |
- gcc_ubuntu_arm64 | |
- cmake_ubuntu_x86_64 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Compress Sources | |
uses: a7ul/tar-action@v1.1.0 | |
id: compress | |
with: | |
command: c | |
files: | | |
../sparkyuv | |
outPath: sparkyuv.tar.gz | |
- name: Download All Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
- run: ls -la | |
- uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "sparkyuv.tar.gz,libsparkyuv.linux-*.tar.gz" |