mirror of
https://github.com/DanielSWolf/rhubarb-lip-sync.git
synced 2026-11-21 12:25:08 +00:00
120 lines
3.2 KiB
YAML
120 lines
3.2 KiB
YAML
name: Build
|
|
|
|
on: push
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: windows-2022
|
|
compiler: msvc
|
|
publish: true
|
|
- os: macos-14
|
|
compiler: xcode
|
|
publish: true
|
|
- os: ubuntu-24.04
|
|
compiler: gcc
|
|
publish: true
|
|
- os: ubuntu-24.04
|
|
compiler: clang
|
|
publish: false
|
|
|
|
env:
|
|
BOOST_ROOT: ${{ github.workspace }}/lib/boost
|
|
BOOST_URL: https://sourceforge.net/projects/boost/files/boost/1.86.0/boost_1_86_0.tar.bz2/download
|
|
|
|
steps:
|
|
- name: Deactivate EOL conversion
|
|
shell: bash
|
|
run: |
|
|
git config --global core.autocrlf false
|
|
git config --global core.eol lf
|
|
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
lfs: true
|
|
|
|
- name: Install NPM dependencies
|
|
shell: bash
|
|
run: npm install
|
|
|
|
- name: Restore Boost from cache
|
|
uses: actions/cache@v4
|
|
id: cache-boost
|
|
with:
|
|
path: ${{ env.BOOST_ROOT }}
|
|
key: ${{ env.BOOST_URL }}
|
|
|
|
- name: Download Boost
|
|
if: steps.cache-boost.outputs.cache-hit != 'true'
|
|
shell: bash
|
|
run: |
|
|
if [ "$RUNNER_OS" == "Windows" ]; then
|
|
# use forward slashes only
|
|
BOOST_ROOT=$(echo $BOOST_ROOT | sed 's/\\/\//g')
|
|
fi
|
|
mkdir -p $BOOST_ROOT
|
|
curl --insecure -L $BOOST_URL | tar -xj --strip-components=1 -C $BOOST_ROOT
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: temurin
|
|
java-version: 21
|
|
|
|
- name: Check code
|
|
shell: bash
|
|
run: npm run check
|
|
|
|
- name: Build, test, and package
|
|
shell: bash
|
|
run: npm run build -- --test --compiler ${{ matrix.compiler }}
|
|
|
|
- name: Upload artifacts
|
|
if: ${{ matrix.publish }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: 'binaries ${{ matrix.os }} ${{ matrix.compiler }}'
|
|
path: |
|
|
cli-build/*.zip
|
|
cli-build/*.tar.xz
|
|
release:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
steps:
|
|
- name: Checkout changelog
|
|
uses: actions/checkout@v4
|
|
with:
|
|
sparse-checkout: CHANGELOG.md
|
|
|
|
- name: Extract changelog data
|
|
run: |
|
|
# Store the release name in env.releaseName
|
|
HEADER=$(awk '/^## / {sub(/^## /, ""); print; exit}' CHANGELOG.md)
|
|
echo "releaseName=$HEADER" >> $GITHUB_ENV
|
|
|
|
# Store the changelog body in changes.txt
|
|
awk '/^## / {if (found) exit; found=1; next} found' CHANGELOG.md > changes.txt
|
|
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
merge-multiple: true
|
|
|
|
- name: Create GitHub release draft
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
draft: true
|
|
name: ${{ env.releaseName }}
|
|
body_path: changes.txt
|
|
files: |
|
|
'*.zip'
|
|
'*.tar.gz'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|