[fixed] github pipeline yaml file for publishing package of embedded lib #2
This file contains hidden or 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: Embedded Lib Conan Package | ||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| tags: [ "*" ] | ||
| pull_request: | ||
| jobs: | ||
| build-and-publish: | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: ubuntu:24.04 | ||
| options: --user 0 | ||
| steps: | ||
| # 1. Checkout repo | ||
| - uses: actions/checkout@v4 | ||
| # 2. Set up Docker Buildx | ||
| - name: Build dev container | ||
| run: | | ||
| docker build -t my-dev -f .devcontainer/Dockerfile . | ||
| docker run my-dev echo "Container built" | ||
| # 2. Verify environment | ||
| - name: Check environment | ||
| run: | | ||
| which conan | ||
| conan --version | ||
| cmake --version | ||
| gcc --version | ||
| # 3. Configure Conan remote | ||
| - 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 }} | ||
| # 4. Create the package | ||
| - name: Create Conan package | ||
| run: | | ||
| conan create . --version=0.1.0 --user=${{ github.actor }} --channel=stable | ||
| # 5. Upload the package | ||
| - name: Upload package | ||
| run: | | ||
| conan upload "*/0.1.0@" --all -r=github --confirm | ||
| env: | ||
| CONAN_LOGIN_USERNAME: ${{ github.actor }} | ||
| CONAN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | ||