Skip to content

Merge pull request #48 from A-Baji/dev #109

Merge pull request #48 from A-Baji/dev

Merge pull request #48 from A-Baji/dev #109

Workflow file for this run

name: package_release
on:
push:
tags:
- '*.*.*'
pull_request:
jobs:
test-package:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
py_ver:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py_ver }}
- name: Install Package
run: pip install .
- name: Test Package
env:
PY_VER: ${{ matrix.py_ver }}
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
CHANNEL_ID: ${{ secrets.CHANNEL_ID }}
USERNAME: ${{ secrets.USERNAME }}
PYTHONUNBUFFERED: 1
run: |
touch .env.test
export VERSION=$(cat discordai_modelizer/version.py | grep -oP '\d+\.\d+\.\d+')
docker compose -f docker-compose-test.yaml up --build --exit-code-from tests
release:
if: |
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags') &&
github.repository_owner == 'A-Baji'
needs: test-package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: version
name: Get build metadata
run: echo "::set-output name=discordai_modelizer_version::$(cat discordai_modelizer/version.py | grep -oP '\d+\.\d+\.\d+')"
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.discordai_modelizer_version }}
release_name: Release ${{ steps.version.outputs.discordai_modelizer_version }}
body: Release ${{ steps.version.outputs.discordai_modelizer_version }}
draft: false
prerelease: false