Skip to content

Commit

Permalink
Release creating added to build
Browse files Browse the repository at this point in the history
  • Loading branch information
artiomn authored Nov 6, 2024
1 parent f05d5c9 commit e8c3a35
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions .github/workflows/cmake-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ jobs:
id: strings
shell: bash
run: |
echo "build-output-dir=build" >> "$GITHUB_OUTPUT"
echo "build-output-dir=build_${{ matrix.c_compiler }}" >> "$GITHUB_OUTPUT"
- name: Configure CMake
run: >
${{ matrix.pre_run_comman }} cmake -B ${{ steps.strings.outputs.build-output-dir }}
${{ matrix.pre_run_comman }} cmake -B ${{ steps.strings.outputs.build-output-dir }}_${{ matrix.c_compiler }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
Expand All @@ -89,3 +89,32 @@ jobs:
- name: Create packages
run: docker run --rm -v ${{ github.workspace }}:/KNP -w /KNP/${{ steps.strings.outputs.build-output-dir }} ${{ vars.DOCKERHUB_LOGIN }}/knp-build-image cpack -G DEB
timeout-minutes: 180

publish:
- name: Create new release
id: create_release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && ${{ matrix.c_compiler }} == 'gcc'
uses: juitnow/github-action-create-release@v1
env:
# This token is provided by Actions.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
files: |
${{ steps.strings.outputs.build-output-dir }}/_packages/*.deb
body: |
Release creating added to CI
draft: false
prerelease: false

# - name: Publish package to the PyPI
# Already on push in the master branch.
# if: startsWith(github.head_ref, 'master')
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}
# repository_url: https://upload.pypi.org/legacy/
# skip_existing: true
print_hash: true

0 comments on commit e8c3a35

Please sign in to comment.