mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
ce2e3ab52e
Somehwere between yabridge 1.1.4 and 1.2.0 we apparently started requiring newer libstc++ features, and I kind of forgot that libstdc++ needed is bound to the version of g++ the program was compiled with. Statically linking libstdc++ could in theory cause issues, but I think we'll be fine.
138 lines
5.2 KiB
YAML
138 lines
5.2 KiB
YAML
name: Automated builds
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**'
|
|
tags:
|
|
# Run when pushing version tags, since otherwise it's impossible to
|
|
# restart a successful build after pushing a tag
|
|
- '*.*.*'
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
release:
|
|
types: [created]
|
|
|
|
defaults:
|
|
run:
|
|
# This otherwise gets run under dash which does not support brace expansion
|
|
shell: bash
|
|
|
|
jobs:
|
|
build-bionic:
|
|
name: Build on Ubuntu 18.04
|
|
runs-on: ubuntu-latest
|
|
# This container contains everything needed to build yabridge except for
|
|
# Boost since that's not easily available and it the parts we need are
|
|
# quick to compile anyway
|
|
container: robbert/docker-yabridge:bionic
|
|
outputs:
|
|
artifact-name: ${{ env.ARCHIVE_NAME }}
|
|
# GitHub actions does not allow you to share steps between jobs and their
|
|
# yaml parser does not support anchors, so we'll have to duplicate all of
|
|
# these steps
|
|
# https://github.community/t5/GitHub-Actions/reusing-sharing-inheriting-steps-between-jobs-declarations/td-p/37849
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
# Needed for git-describe to do anything useful
|
|
- name: Fetch all git history
|
|
run: git fetch --force --prune --tags --unshallow
|
|
- name: Determine build archive name
|
|
run: |
|
|
export ARCHIVE_NAME=yabridge-$(git describe --always)-ubuntu-18.04.tar.gz
|
|
echo ::set-env "name=ARCHIVE_NAME::$ARCHIVE_NAME"
|
|
- name: Build the binaries
|
|
run: |
|
|
# Wine won't create a Wine prefix in ~/.wine because /github/home is
|
|
# not owned by the user that's executing this job
|
|
mkdir -p /tmp/prefix
|
|
export WINEPREFIX=/tmp/prefix
|
|
|
|
# Statically link to libstdc++ on Ubuntu 18.04 as we're compiling
|
|
# with a newer version of g++ than what's in the default repos
|
|
meson setup --buildtype=release --cross-file cross-wine.conf -Duse-bitbridge=true -Dcpp_link_args='-static-libstdc++' -Dbuild.cpp_link_args='-static-libstdc++' build
|
|
ninja -C build
|
|
- name: Create an archive for the binaries
|
|
run: |
|
|
mkdir yabridge
|
|
cp build/libyabridge.so build/yabridge-{host,group}{,-32}.exe{,.so} yabridge
|
|
cp CHANGELOG.md README.md yabridge
|
|
|
|
tar -caf "$ARCHIVE_NAME" yabridge
|
|
rm -rf yabridge
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: ${{ env.ARCHIVE_NAME }}
|
|
path: ${{ env.ARCHIVE_NAME }}
|
|
|
|
build-focal:
|
|
name: Build on Ubuntu 20.04
|
|
runs-on: ubuntu-latest
|
|
# This container contains everything needed to build yabridge except for
|
|
# Boost since that's not easily available and it the parts we need are
|
|
# quick to compile anyway
|
|
container: robbert/docker-yabridge:focal
|
|
outputs:
|
|
artifact-name: ${{ env.ARCHIVE_NAME }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
# Needed for git-describe to do anything useful
|
|
- name: Fetch all git history
|
|
run: git fetch --force --prune --tags --unshallow
|
|
- name: Determine build archive name
|
|
run: |
|
|
export ARCHIVE_NAME=yabridge-$(git describe --always).tar.gz
|
|
echo ::set-env "name=ARCHIVE_NAME::$ARCHIVE_NAME"
|
|
- name: Build the binaries
|
|
run: |
|
|
# Wine won't create a Wine prefix in ~/.wine because /github/home is
|
|
# not owned by the user that's executing this job
|
|
mkdir -p /tmp/prefix
|
|
export WINEPREFIX=/tmp/prefix
|
|
|
|
meson setup --buildtype=release --cross-file cross-wine.conf -Duse-bitbridge=true build
|
|
ninja -C build
|
|
- name: Create an archive for the binaries
|
|
run: |
|
|
mkdir yabridge
|
|
cp build/libyabridge.so build/yabridge-{host,group}{,-32}.exe{,.so} yabridge
|
|
cp CHANGELOG.md README.md yabridge
|
|
|
|
tar -caf "$ARCHIVE_NAME" yabridge
|
|
rm -rf yabridge
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: ${{ env.ARCHIVE_NAME }}
|
|
path: ${{ env.ARCHIVE_NAME }}
|
|
|
|
upload-releases:
|
|
name: Upload the created artifacts to the releases page
|
|
runs-on: ubuntu-latest
|
|
needs: [build-bionic, build-focal]
|
|
if: ${{ github.event_name == 'release' }}
|
|
steps:
|
|
# They don't allow you to specify multiple file names for these actions
|
|
- uses: actions/download-artifact@v2
|
|
with:
|
|
name: ${{ needs.build-bionic.outputs.artifact-name }}
|
|
- uses: actions/download-artifact@v2
|
|
with:
|
|
name: ${{ needs.build-focal.outputs.artifact-name }}
|
|
- uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: ./${{ needs.build-bionic.outputs.artifact-name }}
|
|
asset_name: $${{ needs.build-bionic.outputs.artifact-name }}
|
|
asset_content_type: application/x-compressed-tar
|
|
- uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: ./${{ needs.build-focal.outputs.artifact-name }}
|
|
asset_name: $${{ needs.build-focal.outputs.artifact-name }}
|
|
asset_content_type: application/x-compressed-tar
|