2021-08-27 22:21:04 +02:00
|
|
|
# github workflow to automate builds
|
|
|
|
|
2020-11-07 19:43:23 +01:00
|
|
|
name: Linux build
|
2020-10-05 03:25:15 +02:00
|
|
|
|
2022-08-30 20:45:22 +02:00
|
|
|
on: [push, pull_request, workflow_dispatch]
|
2020-10-05 03:25:15 +02:00
|
|
|
|
|
|
|
env:
|
|
|
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
|
|
|
BUILD_TYPE: Release
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
# The CMake configure and build commands are platform agnostic and should work equally
|
|
|
|
# well on Windows or Mac. You can convert this to a matrix build if you need
|
|
|
|
# cross-platform coverage.
|
|
|
|
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix
|
2020-11-07 19:43:23 +01:00
|
|
|
name: CMake, Ubuntu
|
2021-03-28 18:58:50 +02:00
|
|
|
runs-on: ubuntu-18.04
|
2020-10-05 03:25:15 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2021-08-27 22:21:04 +02:00
|
|
|
- name: Fetch Git tags
|
2020-10-19 03:34:16 +02:00
|
|
|
run: |
|
|
|
|
git fetch --prune --unshallow --tags
|
|
|
|
|
2021-08-27 22:21:04 +02:00
|
|
|
- name: Install dependencies
|
2020-10-05 03:25:15 +02:00
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2021-10-23 09:48:06 +02:00
|
|
|
sudo apt-get install -y libvorbis-dev libjansson-dev yasm libopus-dev
|
2020-10-05 03:25:15 +02:00
|
|
|
|
2021-08-27 22:21:04 +02:00
|
|
|
- name: Create build environment
|
2020-10-05 03:25:15 +02:00
|
|
|
# Some projects don't allow in-source building, so create a separate build directory
|
|
|
|
# We'll use this as our working directory for all subsequent commands
|
|
|
|
run: cmake -E make_directory ${{runner.workspace}}/build
|
|
|
|
|
2021-10-23 09:48:06 +02:00
|
|
|
- name: Cache celt
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{runner.workspace}}/dependencies/celt-0061
|
|
|
|
${{runner.workspace}}/dependencies/celt-0110
|
|
|
|
${{runner.workspace}}/build/dependencies/celt-0061/libcelt/.libs
|
|
|
|
${{runner.workspace}}/build/dependencies/celt-0110/libcelt/.libs
|
|
|
|
key: linux-celt-${{ hashFiles('cmake/dependencies/celt.cmake') }}
|
|
|
|
|
|
|
|
- name: Cache ffmpeg
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{runner.workspace}}/build/dependencies/ffmpeg/bin/usr/local/include
|
|
|
|
${{runner.workspace}}/build/dependencies/ffmpeg/bin/usr/local/lib
|
|
|
|
key: linux-ffmpeg-${{ hashFiles('cmake/dependencies/ffmpeg.cmake') }}
|
|
|
|
|
|
|
|
- name: Cache atrac9
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{runner.workspace}}/build/dependencies/LibAtrac9/bin
|
|
|
|
key: linux-atrac9-${{ hashFiles('cmake/dependencies/atrac9.cmake') }}
|
|
|
|
|
|
|
|
- name: Cache g719
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{runner.workspace}}/build/dependencies/libg719_decode/libg719_decode.a
|
|
|
|
key: linux-g719-${{ hashFiles('cmake/dependencies/g719.cmake') }}
|
|
|
|
|
|
|
|
- name: Cache mpg123
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{runner.workspace}}/dependencies/mpg123
|
|
|
|
${{runner.workspace}}/build/dependencies/mpg123/src/libmpg123/.libs
|
|
|
|
key: linux-mpg123-${{ hashFiles('cmake/dependencies/mpg123.cmake') }}
|
|
|
|
|
|
|
|
- name: Cache speex
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{runner.workspace}}/build/dependencies/speex/libspeex/.libs
|
|
|
|
key: linux-speex-${{ hashFiles('cmake/dependencies/speex.cmake') }}
|
|
|
|
|
2020-10-05 03:25:15 +02:00
|
|
|
- name: Configure CMake
|
|
|
|
# Use a bash shell so we can use the same syntax for environment variable
|
|
|
|
# access regardless of the host operating system
|
|
|
|
shell: bash
|
|
|
|
working-directory: ${{runner.workspace}}/build
|
|
|
|
# Note the current convention is to use the -S and -B options here to specify source
|
|
|
|
# and build directories, but this is only available with CMake 3.13 and higher.
|
|
|
|
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
|
2021-08-31 13:59:06 +02:00
|
|
|
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_STATIC=ON
|
2020-10-05 03:25:15 +02:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
working-directory: ${{runner.workspace}}/build
|
|
|
|
shell: bash
|
|
|
|
# Execute the build. You can specify a specific target with "--target <NAME>"
|
|
|
|
run: cmake --build . --config $BUILD_TYPE
|
2020-10-05 05:54:45 +02:00
|
|
|
|
2021-08-31 13:59:06 +02:00
|
|
|
- name: Upload CLI tools artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
${{runner.workspace}}/build/cli/vgmstream-cli
|
|
|
|
# ${{runner.workspace}}/build/cli/vgmstream123
|
|
|
|
name: vgmstream-cli
|
2021-08-27 22:21:04 +02:00
|
|
|
|
|
|
|
#- name: Upload Audacious plugin artifact
|
|
|
|
# uses: actions/upload-artifact@v2
|
|
|
|
# with:
|
|
|
|
# path: ${{runner.workspace}}/build/audacious/vgmstream.so
|
|
|
|
# name: vgmstream-audacious
|
|
|
|
|
2021-08-31 13:59:06 +02:00
|
|
|
- name: Upload artifacts to S3
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
working-directory: ${{runner.workspace}}/build
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
AWS_DEFAULT_REGION: us-west-1
|
|
|
|
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
|
|
|
|
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
|
|
|
|
# TODO: Add vgmstream123 to the archive and upload the Audacious plugin when it is supported
|
|
|
|
run: |
|
|
|
|
cd cli
|
|
|
|
tar cvfz vgmstream-cli.tar.gz vgmstream-cli
|
|
|
|
cd ..
|
|
|
|
aws s3 cp cli/vgmstream-cli.tar.gz s3://vgmstream-builds/${{github.sha}}/linux/vgmstream-cli.tar.gz --acl public-read
|
2022-08-30 20:43:01 +02:00
|
|
|
cd ${{runner.workspace}}
|
2022-08-30 20:35:36 +02:00
|
|
|
echo ${{github.sha}} | tee latest_id_lx
|
|
|
|
aws s3 cp latest_id_lx s3://vgmstream-builds/ --acl public-read
|
2021-08-31 13:59:06 +02:00
|
|
|
# cd audacious
|
|
|
|
# tar cvfz vgmstream-audacious.tar.gz vgmstream.so
|
|
|
|
# cd ..
|
|
|
|
# aws s3 cp audacious/vgmstream-audacious.tar.gz s3://vgmstream-builds/${{github.sha}}/linux/vgmstream-audacious.tar.gz --acl public-read
|