Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 35 additions & 50 deletions .github/workflows/tagged-release-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,60 @@
name: Tagged Release Workflow
permissions:
contents: read
permissions:
contents: write

on:
push:
tags:
- "v*"

jobs:
build:
create-release:
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest

strategy:
fail-fast: false

matrix:
build-tool: [ ninja ]
compiler: [ mingw64, gcc ]
architecture: [ x64, x86 ]
target: [ win, linux ]
architecture: [ x64, x86 ]
compiler: [ mingw64, gcc ]
build-type: [ release ]
exclude:
- target: windows
compiler: gcc
- target: ubuntu
- target: linux
compiler: mingw64

steps:
- uses: actions/checkout@v4

- name: Initialise Variables
shell: bash
run: |
echo "current-build-tool=${{ matrix.build-tool }}" >> $GITHUB_ENV
echo "current-compiler=${{ matrix.compiler }}" >> $GITHUB_ENV
echo "current-architecture=${{ matrix.architecture }}" >> $GITHUB_ENV
echo "current-os=${{ matrix.target }}" >> $GITHUB_ENV
echo "current-build-type=${{ matrix.build-type }}" >> $GITHUB_ENV
echo "build-step-title=${{ env.current-build-tool }}-${{ env.current-compiler }}-${{ env.current-architecture }}-${{ env.current-os }}-${{ env.current-build-type }}" >> $GITHUB_ENV
echo "configure-step-title=${{ env.current-build-tool }}-${{ env.current-compiler }}-${{ env.current-architecture }}-${{ env.current-os }}" >> $GITHUB_ENV
echo "release-title=${{ env.current-architecture }}-${{ env.current-os }}-${{ env.current-build-type }}" >> $GITHUB_ENV
echo "build
- name: Initialise Runner
- name: Create Release
uses: VolcanusLucis/.github/.github/actions/create-release@master
with:
tag: ${{ github.ref_name }}
draft: 'true'

- name: Build
uses: VolcanusLucis/.github/.github/actions/build-cmake-project-presets@master
with:
target: ${{ matrix.target }}
architecture: ${{ matrix.architecture }}
compiler: ${{ matrix.compiler }}
build-type: ${{ matrix.build-type }}

- name: Install
if: success()
shell: bash
run: |
sudo apt remove cmake -y
sudo pip install cmake --upgrade
if [ "${{ matrix.target }}" == "win" ]; then
if [ "${{ matrix.architecture }}" == "x64"]; then
sudo apt install gcc-mingw-w64-x86-64
sudo apt install g++-mingw-w64-x86-64
else
sudo apt install gcc-mingw-w64-i686
sudo apt install g++-mingw-w64-i686
fi
sudo apt install zip
else
sudo apt install gcc-multilib
sudo apt install g++-multilib
fi

- name: Configure CMake
shell: bash
run: cmake -S "${{ github.workspace }}" --preset ${{ env.configure-step-title }}

- name: Build
run: cmake --build --preset ${{ env.build-step-title }}

- name: Package Build
echo "folder=${{ matrix.target }}-${{ matrix.architecture }}-${{ matrix.compiler }}" >> $GITHUB_ENV
cmake --install "build/${{ env.folder }}" --prefix "install/${{ env.folder }}" --config ${{ matrix.build-type }}

- name: Package
shell: bash
run: |
tar czf ${{ env.release-title }}.tar.gz ${{ github.workspace }}/build/${{ env.configure-step-title }}
tar -C install/ -czf libvlmath-${{ env.folder }}.tar.gz ${{ env.folder }}

- name: Upload
uses: VolcanusLucis/.github/.github/actions/upload-to-release@master
with:
tag: ${{ github.ref_name }}
file: 'libvlmath-${{ env.folder }}.tar.gz'