Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fixed readme and removed theory files #13

Fixed readme and removed theory files

Fixed readme and removed theory files #13

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate Changelog
run: |
CURRENT_TAG=${GITHUB_REF#refs/tags/}
echo "Current tag: $CURRENT_TAG"
# Find previous tag
# git describe --tags --abbrev=0 HEAD^ might fail if no tags or shallow
# We fetched depth 0 so we have history.
# Get list of tags sorted by date desc
TAGS=$(git tag --sort=-creatordate)
# Assuming CURRENT_TAG is the first one
PREV_TAG=$(echo "$TAGS" | sed -n '2p')
echo "Previous tag: $PREV_TAG"
echo "## What's Changed" > changelog.md
echo "" >> changelog.md
if [ -z "$PREV_TAG" ]; then
git log --pretty=format:"* %s (%h)" >> changelog.md
else
echo "Changes from $PREV_TAG to $CURRENT_TAG:" >> changelog.md
echo "" >> changelog.md
git log --pretty=format:"* %s (%h)" $PREV_TAG..$CURRENT_TAG >> changelog.md
fi
echo "" >> changelog.md
- name: Create Release
uses: softprops/action-gh-release@v2
with:
body_path: changelog.md
draft: false
prerelease: false
build-release:
name: Build Release (${{ matrix.os }})
needs: create-release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
asset_name: concordia-linux-amd64.tar.gz
- os: windows-latest
asset_name: concordia-windows-amd64.zip
- os: macos-latest
asset_name: concordia-macos-amd64.tar.gz
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build --config Release
- name: Run Tests (Unix)
if: runner.os != 'Windows'
run: ./build/tests/test_runner
- name: Run Tests (Windows)
if: runner.os == 'Windows'
run: .\build\tests\Release\test_runner.exe
- name: Install to Staging
run: cmake --install build --config Release --prefix staging
- name: Archive Release (Unix)
if: runner.os != 'Windows'
run: |
cd staging
tar -czvf ../${{ matrix.asset_name }} *
- name: Archive Release (Windows)
if: runner.os == 'Windows'
run: |
Compress-Archive -Path staging\* -DestinationPath ${{ matrix.asset_name }}
- name: Upload Release Asset
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ matrix.asset_name }}