Dependencies: Re-add pyodbc #19
This file contains 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: Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
if: false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: '0' | |
- name: Get tag | |
id: get_tag | |
run: | | |
get_tag=$(cat setup.py | grep -E '__version__ =' | awk '{print $3}' | tr -d \") | |
last_tag=$(git describe --tags --abbrev=0) | |
echo ::set-output name=tag::$get_tag | |
echo ::set-output name=last_tag::$last_tag | |
- name: Bump version and push tag | |
if: steps.get_tag.outputs.tag != steps.get_tag.outputs.last_tag | |
id: bumptag | |
uses: anothrNick/github-tag-action@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CUSTOM_TAG: ${{ steps.get_tag.outputs.tag }} | |
- name: Run build | |
if: steps.get_tag.outputs.tag != steps.get_tag.outputs.last_tag | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel | |
python setup.py sdist bdist_wheel | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@v1 | |
if: steps.get_tag.outputs.tag != steps.get_tag.outputs.last_tag | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
- name: Login to OCI registry | |
if: steps.get_tag.outputs.tag != steps.get_tag.outputs.last_tag | |
uses: azure/docker-login@v1 | |
with: | |
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }} | |
username: ${{ secrets.REGISTRY_USERNAME }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- name: Build and push OCI image | |
if: steps.get_tag.outputs.tag != steps.get_tag.outputs.last_tag | |
run: | | |
docker build -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/tsperf:${{ steps.get_tag.outputs.tag }} . | |
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/tsperf:${{ steps.get_tag.outputs.tag }} |