Skip to content

♿ releases fix

♿ releases fix #3

Workflow file for this run

name: Semantic Release
on:
push:
branches:
- main
env:
CMAKE_VERSION: "3.27.x"
PYTHON_VERSION: "3.13"
jobs:
release:
runs-on: ubuntu-latest
concurrency: release
permissions:
id-token: write
contents: write
outputs:
released: ${{ steps.release.outputs.released }}
tag: ${{ steps.release.outputs.tag }}
steps:
# Note: we need to checkout the repository at the workflow sha in case during the workflow
# the branch was updated. To keep PSR working with the configured release branches,
# we force a checkout of the desired release branch but at the workflow sha HEAD.
- name: Setup | Checkout Repository at workflow sha
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.sha }}
- name: Setup | Force correct release branch on workflow sha
run: |
git checkout -B ${{ github.ref_name }} ${{ github.sha }}
- name: Action | Semantic Version Release
id: release
# Adjust tag with desired version if applicable.
uses: python-semantic-release/[email protected]
with:
build: false
github_token: ${{ secrets.GITHUB_TOKEN }}
git_committer_name: "github-actions"
git_committer_email: "[email protected]"
package:
needs: [release]
if: needs.release.outputs.released
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: abatilo/actions-poetry@v2
- name: Configure runner (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -yq clang ninja-build rpm
- name: Configure runner (Windows)
uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: ${{ env.CMAKE_VERSION }}
- name: Install Conan
run: |
poetry install
poetry run conan version
- name: Restore Conan cache
uses: actions/cache@v4
with:
path: ~/.conan2
key: ${{ runner.os }}-${{ hashFiles('**/conan.lock') }}-Release
- name: Install package dependencies
run: poetry run conan install . --profile:all=./.conan2/profiles/${{ runner.os }} --output-folder=build --build=missing --lockfile-partial
- name: Configure
run: cmake --preset conan-release
- name: Build
run: cmake --build --preset conan-release
- name: Package
run: cpack --config CPackConfig.cmake
working-directory: build
- name: Upload to GitHub Release Assets
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "packages/*.rpm; packages/*.exe"
tag_name: ${{ needs.release.outputs.tag }}