Skip to content

Build on main

Build on main #43

Workflow file for this run

name: Build on main
on:
push:
branches:
- main
schedule:
- cron: '0 0 * * 5'
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: msys2/setup-msys2@v2
with:
location: D:\msys2_github\
update: true
install: >-
mingw-w64-x86_64-cmake
mingw-w64-x86_64-gcc
mingw-w64-x86_64-nasm
mingw-w64-x86_64-yasm
mingw-w64-x86_64-ninja
mingw-w64-x86_64-pkg-config
mingw-w64-x86_64-meson
git
base-devel
autotools
msystem: MINGW64
path-type: strict
- name: install obuparse
shell: msys2 {0}
run: |
export HOME=${{ github.workspace }}
git clone https://github.com/dwbuiten/obuparse
cd obuparse
gcc -c obuparse.c
ar r libobuparse.a obuparse.o
install obuparse.h /mingw64/include
install libobuparse.a /mingw64/lib
- name: build
shell: msys2 {0}
run: |
export HOME=${{ github.workspace }}
export LDFLAGS="-static -static-libgcc -static-libstdc++ -s"
export CFLAGS=-"flto"
export CXXFLAGS="$CFLAGS"
git clone https://github.com/vimeo/l-smash
cd l-smash
./configure
make -j 2
- name: postprocessing
shell: cmd
run: |
for /f "delims=" %%i in ('git -C l-smash log -1 --format^="%%h"') do set "shorthash=%%i"
for /f "delims=" %%i in ('git -C l-smash rev-list --count HEAD') do set "revision=%%i"
copy /y l-smash\cli\*.exe .\
copy /y l-smash\LICENSE l-smash_LICENSE.txt
copy /y obuparse\LICENSE obuparse_LICENSE.txt
7z a "l-smash-vimeo_r%revision%-%shorthash%.7z" *.exe l-smash_LICENSE.txt obuparse_LICENSE.txt
- name: Upload result
uses: actions/upload-artifact@v3
with:
name: l-smash
path: |
l-smash-vimeo_*.7z
create_release:
name: Create release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: l-smash
path: artifacts
- name: Get Date
id: get_date
run: |
DATE_TIME=`date +'%Y-%m-%d-%H-%M-%S'`
echo "DATE_TIME=${DATE_TIME}" >> $GITHUB_OUTPUT
# https://github.com/Mr-Ojii/L-SMASH-Works-Auto-Builds
- name: Create a Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RELEASE_NAME=Build-${{ steps.get_date.outputs.DATE_TIME }}
TAG_NAME=build-${{ steps.get_date.outputs.DATE_TIME }}
assets=()
for asset in ${{ github.workspace }}/artifacts/*.7z; do
assets+=("-a" "$asset")
done
hub release create "${assets[@]}" -m "$RELEASE_NAME" "$TAG_NAME"