Initial release #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.*' | |
permissions: | |
packages: read | |
contents: write | |
jobs: | |
create_release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
release_assets: | |
name: Release Assets | |
needs: create_release | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
build_type: [Release] | |
cpp_compiler: [g++-13, cl] | |
include: | |
- os: windows-latest | |
cpp_compiler: cl | |
- os: ubuntu-latest | |
cpp_compiler: g++-13 | |
exclude: | |
- os: windows-latest | |
cpp_compiler: g++-13 | |
- os: ubuntu-latest | |
cpp_compiler: cl | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set Reusable Strings | |
id: strings | |
shell: bash | |
run: | | |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | |
- name: Install GCC | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
shell: bash | |
run: | | |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test | |
sudo apt-get update | |
sudo apt-get -y install g++-13 | |
- name: Configure CMake | |
run: > | |
cmake -B ${{ steps.strings.outputs.build-output-dir }} | |
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | |
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
-S ${{ github.workspace }} | |
- name: Build | |
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} | |
- name: Upload Ubuntu Assets | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_name: vtdoom | |
asset_path: ${{ steps.strings.outputs.build-output-dir }}/vtdoom | |
asset_content_type: application/octet-stream | |
- name: Upload Windows Assets | |
if: ${{ matrix.os == 'windows-latest' }} | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_name: vtdoom.exe | |
asset_path: ${{ steps.strings.outputs.build-output-dir }}/Release/vtdoom.exe | |
asset_content_type: application/octet-stream |