Try buildx

pull/266/head
Michael Hansen 7 months ago
parent cfb193f113
commit d57fda578c

@ -3,8 +3,11 @@ name: main
on: on:
workflow_dispatch: workflow_dispatch:
push: push:
tags: branches:
- "*" - master
# push:
# tags:
# - "*"
jobs: jobs:
create_release: create_release:
@ -24,98 +27,90 @@ jobs:
draft: false draft: false
prerelease: false prerelease: false
build_linux: build_linux:
name: "linux build: ${{ matrix.arch }}" name: "linux build"
runs-on: ubuntu-20.04 # use older version on purpose for GLIBC runs-on: ubuntu-latest
needs: create_release # we need to know the upload URL needs: create_release # we need to know the upload URL
strategy:
fail-fast: true
matrix:
arch: [x64, aarch64, armv7]
steps:
- uses: actions/checkout@v3
- name: configure
run: |
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=_install/piper -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }}
- name: build
run: |
cmake --build build --config Release
- name: install
run: |
cmake --install build
- name: package
run: |
cd _install && \
tar -czf piper_linux_${{ matrix.arch }}.tar.gz piper/
- name: upload
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: _install/piper_linux_${{ matrix.arch }}.tar.gz
asset_name: piper_linux_${{ matrix.arch }}.tar.gz
asset_content_type: application/octet-stream
build_windows:
runs-on: windows-latest
name: "windows build: ${{ matrix.arch }}"
needs: create_release # we need to know the upload URL
strategy:
fail-fast: true
matrix:
arch: [x64]
steps:
- uses: actions/checkout@v3
- name: configure
run: |
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=_install/piper
- name: build
run: |
cmake --build build --config Release
- name: install
run: |
cmake --install build
- name: package
run: |
cd _install
Compress-Archive -LiteralPath piper -DestinationPath piper_windows_amd64.zip
- name: upload
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: _install/piper_windows_amd64.zip
asset_name: piper_windows_amd64.zip
asset_content_type: application/zip
build_macos:
name: "macos build: ${{ matrix.arch }}"
runs-on: macos-latest
needs: create_release # we need to know the upload URL
strategy:
fail-fast: true
matrix:
arch: [x64, aarch64]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: configure - uses: docker/setup-qemu-action@v2
run: | - uses: docker/setup-buildx-action@v2
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=_install/piper
- name: build - name: build
run: | run: |
cmake --build build --config Release docker buildx build . --platform linux/arm64 --output 'type=local,dest=dist'
- name: install # - name: package
run: | # run: |
cmake --install build # cd _install && \
- name: package # tar -czf piper_linux_${{ matrix.arch }}.tar.gz piper/
run: | # - name: upload
cd _install && \ # uses: actions/upload-release-asset@v1
tar -czf piper_macos_${{ matrix.arch }}.tar.gz piper/ # env:
- name: upload # GITHUB_TOKEN: ${{ github.token }}
uses: actions/upload-release-asset@v1 # with:
env: # upload_url: ${{ needs.create_release.outputs.upload_url }}
GITHUB_TOKEN: ${{ github.token }} # asset_path: _install/piper_linux_${{ matrix.arch }}.tar.gz
with: # asset_name: piper_linux_${{ matrix.arch }}.tar.gz
upload_url: ${{ needs.create_release.outputs.upload_url }} # asset_content_type: application/octet-stream
asset_path: _install/piper_macos_${{ matrix.arch }}.tar.gz # build_windows:
asset_name: piper_macos_${{ matrix.arch }}.tar.gz # runs-on: windows-latest
asset_content_type: application/octet-stream # name: "windows build: ${{ matrix.arch }}"
# needs: create_release # we need to know the upload URL
# strategy:
# fail-fast: true
# matrix:
# arch: [x64]
# steps:
# - uses: actions/checkout@v3
# - name: configure
# run: |
# cmake -Bbuild -DCMAKE_INSTALL_PREFIX=_install/piper
# - name: build
# run: |
# cmake --build build --config Release
# - name: install
# run: |
# cmake --install build
# - name: package
# run: |
# cd _install
# Compress-Archive -LiteralPath piper -DestinationPath piper_windows_amd64.zip
# - name: upload
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# upload_url: ${{ needs.create_release.outputs.upload_url }}
# asset_path: _install/piper_windows_amd64.zip
# asset_name: piper_windows_amd64.zip
# asset_content_type: application/zip
# build_macos:
# name: "macos build: ${{ matrix.arch }}"
# runs-on: macos-latest
# needs: create_release # we need to know the upload URL
# strategy:
# fail-fast: true
# matrix:
# arch: [x64, aarch64]
# steps:
# - uses: actions/checkout@v3
# - name: configure
# run: |
# cmake -Bbuild -DCMAKE_INSTALL_PREFIX=_install/piper
# - name: build
# run: |
# cmake --build build --config Release
# - name: install
# run: |
# cmake --install build
# - name: package
# run: |
# cd _install && \
# tar -czf piper_macos_${{ matrix.arch }}.tar.gz piper/
# - name: upload
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# upload_url: ${{ needs.create_release.outputs.upload_url }}
# asset_path: _install/piper_macos_${{ matrix.arch }}.tar.gz
# asset_name: piper_macos_${{ matrix.arch }}.tar.gz
# asset_content_type: application/octet-stream

@ -1,4 +1,4 @@
.PHONY: clean .PHONY: clean docker
all: all:
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=install cmake -Bbuild -DCMAKE_INSTALL_PREFIX=install
@ -6,5 +6,8 @@ all:
cd build && ctest --config Release cd build && ctest --config Release
cmake --install build cmake --install build
docker:
docker buildx build . --platform linux/amd64,linux/arm64,linux/arm/v7 --output 'type=local,dest=dist'
clean: clean:
rm -rf build install rm -rf build install dist

Loading…
Cancel
Save