diff --git a/.github/workflows/tagged-release-workflow.yml b/.github/workflows/tagged-release-workflow.yml index 53dd6ca..9907d8b 100644 --- a/.github/workflows/tagged-release-workflow.yml +++ b/.github/workflows/tagged-release-workflow.yml @@ -1,14 +1,14 @@ 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 @@ -16,60 +16,45 @@ jobs: 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 }} \ No newline at end of file + 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' \ No newline at end of file