Skip to content

Merge pull request #9 from emilcode-dev/feature/ghaction-publish-package #13

Merge pull request #9 from emilcode-dev/feature/ghaction-publish-package

Merge pull request #9 from emilcode-dev/feature/ghaction-publish-package #13

Workflow file for this run

name: Conan Package
on:
push:
tags: [ "v*" ]
workflow_dispatch:
jobs:
build-and-publish:
runs-on: ubuntu-latest
container:
image: ghcr.io/${{ github.repository_owner }}/embedded-lib-dev:latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract version from tag
id: vars
run: |
TAG=${GITHUB_REF#refs/tags/}
VERSION=${TAG#v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Check environment
run: |
conan --version
cmake --version
gcc --version
- name: Configure Conan remote
run: |
conan remote add github "https://conan.pkg.github.com/${{ github.repository_owner }}" --force
conan remote list
env:
CONAN_LOGIN_USERNAME: ${{ github.actor }}
CONAN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- name: Create Conan package
run: |
conan profile detect --force
conan create . --user=${{ github.repository_owner }} --channel=stable
env:
CONAN_REF_VERSION: ${{ steps.vars.outputs.version }}
- name: Upload Conan package
run: |
conan upload "*/${{ steps.vars.outputs.version }}@" --remote=github --confirm
env:
CONAN_LOGIN_USERNAME: ${{ github.actor }}
CONAN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}