Skip to content

fix:Add new session decorator back (#585) #76

fix:Add new session decorator back (#585)

fix:Add new session decorator back (#585) #76

Workflow file for this run

# On Tag creation:
# - Build and publishes libraries to PyPi
name: CI-LIB-RELEASE
on:
push:
tags:
- 'constants/v*' # Push on package tag with version number
- 'framework-core/v*'
- 'framework-qt/v*'
- 'qt/v*'
- 'qt-style/v*'
- 'utils/v*'
jobs:
# Set the environment variables for the rest of release workflow
set-variables:
runs-on: ubuntu-latest
outputs:
to_pypi: ${{ env.TO_PYPI }}
folder: ${{ env.FOLDER }}
package: ${{ env.PACKAGE }}
version: ${{ env.VERSION }}
tag: ${{ env.TAG }}
steps:
- uses: actions/checkout@v3
- name: set environments on full release
shell: bash
run: |
echo "PACKAGE=$(echo ${{ github.ref }} | cut -d/ -f 3-3)" >> $GITHUB_ENV
echo "VERSION=$(echo ${{ github.ref }} | cut -d/ -f 4-4)" >> $GITHUB_ENV
echo "TAG=$(echo ${{ github.ref }} | cut -d/ -f 3-4)" >> $GITHUB_ENV
- name: set lib folder
if: ${{ env.PACKAGE == 'constants' || env.PACKAGE == 'framework-core' || env.PACKAGE == 'framework-qt' || env.PACKAGE == 'qt' || env.PACKAGE == 'qt-style' || env.PACKAGE == 'utils' }}
shell: bash
run: |
echo "FOLDER=libs/${{ env.PACKAGE }}" >> $GITHUB_ENV
echo "TO_PYPI=true" >> $GITHUB_ENV
- name: debug
shell: bash
run: |
echo 'TO_PYPI: ${{ env.TO_PYPI }}'
echo 'FOLDER: ${{ env.FOLDER }}'
echo 'PACKAGE: ${{ env.PACKAGE }}'
echo 'VERSION: ${{ env.VERSION }}'
echo 'TAG: ${{ env.TAG }}'
build-linux:
name: Build platform independent artifacts, and Linux specific artifacts
needs: set-variables
concurrency:
group: ci-${{ github.ref }}
runs-on: ubuntu-latest
outputs:
to_pypi: ${{ needs.set-variables.outputs.to_pypi }}
package: ${{ needs.set-variables.outputs.package }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.7'
- name: install poetry
shell: bash
run: |
pip install poetry==1.5.1
- name: build style
if: ${{ needs.set-variables.outputs.package == 'qt-style' }}
shell: bash
run: |
pip install -r tools/requirements.txt
python tools/build.py build_qt_resources libs/qt-style
- name: poetry build
shell: bash
run: |
cd ${{ needs.set-variables.outputs.folder }}
poetry build
- name: Upload temp artifacts
uses: actions/upload-artifact@v4
if: ${{ needs.set-variables.outputs.to_pypi == 'true' }}
with:
name: dist
path: ${{ needs.set-variables.outputs.folder }}/dist
publish-test:
name: Publish to PyPi (test)
runs-on: ubuntu-latest
needs: build-linux
if: ${{ needs.build-linux.outputs.to_pypi == 'true' }}
environment:
name: staging
url: https://test.pypi.org/project/ftrack-${{ needs.build-linux.outputs.package }}/
steps:
- name: Download temp artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Publish to Test PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
publish-prod:
name: Publish to PyPi (prod)
runs-on: ubuntu-latest
needs: build-linux
if: ${{ needs.build-linux.outputs.to_pypi == 'true' }}
environment:
name: production
url: https://pypi.org/project/ftrack-${{ needs.build-linux.outputs.package }}/
steps:
- name: Download temp artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}