Skip to content

Version 1.3.1

Version 1.3.1 #74

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
tags:
- '*'
pull_request:
branches: [ main ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
name: 'macOS'
artifact-suffix: 'mac'
- os: ubuntu-latest
name: 'Ubuntu'
artifact-suffix: 'linux'
- os: windows-latest
name: 'Windows'
vcpkg-triplet: 'x64-windows-static-md'
artifact-suffix: 'win'
name: '${{ matrix.name }}'
runs-on: ${{ matrix.os }}
permissions:
contents: write # Needed to upload to releases
# needed to generate artifact attestations, see: https://docs.github.com/en/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds
id-token: write
attestations: write
env:
MACOSX_DEPLOYMENT_TARGET: '10.9' # only matters on macOS
VCPKG_DEFAULT_TRIPLET: '${{ matrix.vcpkg-triplet }}'
steps:
- uses: actions/checkout@v4
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_BINDIR="." -DVCPKG_OVERLAY_TRIPLETS=".ci/vcpkg/overlay-triplets/" -DCPACK_PACKAGE_FILE_NAME="maptools-${{ matrix.artifact-suffix }}"
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
# - name: Test
# working-directory: ${{github.workspace}}/build
# # Execute tests defined by the CMake configuration.
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest -C ${{env.BUILD_TYPE}}
- name: Package
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target package
- name: Upload Package
uses: actions/upload-artifact@v4
with:
name: maptools-${{ matrix.artifact-suffix }}
path: ${{github.workspace}}/build/maptools-${{ matrix.artifact-suffix }}.zip
- name: 'Generate artifact attestation'
if: success() && (github.event_name == 'push')
uses: actions/attest-build-provenance@v1
continue-on-error: true
with:
subject-path: '${{github.workspace}}/build/maptools-${{ matrix.artifact-suffix }}.zip'
- name: Upload Release Assets
if: startsWith(github.ref, 'refs/tags/') && (github.repository == 'Warzone2100/maptools-cli')
shell: bash
run: |
SOURCE_TAG="${WZ_GITHUB_REF#refs/tags/}"
echo "Uploading: ${WZ_FULL_OUTPUT_ZIP_PATH}"
gh release upload "${SOURCE_TAG}" "${WZ_FULL_OUTPUT_ZIP_PATH}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WZ_FULL_OUTPUT_ZIP_PATH: '${{github.workspace}}/build/maptools-${{ matrix.artifact-suffix }}.zip'
WZ_GITHUB_REF: ${{ github.ref }}