Skip to content

Merge pull request #39 from Hanra-s-work/renovate/aiohttp-3.x #137

Merge pull request #39 from Hanra-s-work/renovate/aiohttp-3.x

Merge pull request #39 from Hanra-s-work/renovate/aiohttp-3.x #137

name: workflow_runner
on:
push:
tags:
- 'v*.*.*'
branches:
- main
- github_action_stabilisation
pull_request:
workflow_dispatch:
env:
WORKFLOW_RUNNER: "github"
RUNNER_BINARY_NAME: "./runner"
TRAINER_BINARY_NAME: "./trainer"
COMMIT_TITLE: ""
COMMIT_MESSAGE: ""
jobs:
check-runner-health:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Compile code
id: compilation-status
run: |
make fclean
make
- name: Check unit test
id: unit-test-status
run: |
echo "Content of the repository"
ls -ls
echo "Content of the trainner folder"
ls -ls ./trainer_program
echo "Installed packages"
pip list
echo "Activating environment if exists"
if [ -f ./trainer_program/trainer_env/bin/activate ]; then
echo "Environment exists, activating"
source ./trainer_program/trainer_env/bin/activate
echo "Installed packages"
pip list
else
echo "No environment found"
fi
make tests_run
publish-package:
needs: check-runner-health
runs-on: ubuntu-latest
if: ${{ needs.check-runner-health.result == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build package
run: |
make fclean
make
echo "Displaying the content of the repository"
ls -ls
- name: Update author
run: |
git config --local user.name "${{secrets.USER_NAME_E}}"
git config --local user.email "${{secrets.USER_EMAIL_E}}"
- name: Get tag title
run: |
TAG_NAME=${{ github.ref }}
COMMIT_TITLE=$(git tag -l --format='%(subject)' $TAG_NAME)
echo "Commit title: $COMMIT_TITLE"
echo "COMMIT_TITLE=$COMMIT_TITLE" >> $GITHUB_ENV
- name: Extract Tag Info
id: extract_tag_info
run: |
TAG_NAME=${{ github.ref }}
COMMIT_MESSAGE=$(git tag -l --format='%(contents)' $TAG_NAME)
if [[ -n "$COMMIT_MESSAGE" ]]; then
echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> $GITHUB_ENV
else
COMMIT_TITLE=$(git log --format=%s -n 1)
echo "COMMIT_MESSAGE=$COMMIT_TITLE" >> $GITHUB_ENV
fi
- name: Publish binary as GitHub release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ env.RUNNER_BINARY_NAME }}
${{ env.TRAINER_BINARY_NAME }}
name: ${{ env.COMMIT_TITLE }}
body: ${{ env.COMMIT_MESSAGE }}
draft: false
prerelease: false