Skip to content

1.2.0

1.2.0 #314

name: Python package
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- run: poetry install
- run: >
poetry run pytest
--cloud-api-key "${{ secrets.CLOUD_API_KEY }}"
--enterprise-uri "https://test-api.lifecyclesolutions.ni.com" --enterprise-api-key "${{ secrets.ENTERPRISE_API_KEY }}"
- run: poetry run poe check
- run: poetry run poe lint
- run: poetry run poe types
release:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: 3.8
cache: "poetry"
- run: poetry install
- name: Semantic release
run: |
pip install python-semantic-release==7.34.6
git config --global user.name "github-actions"
git config --global user.email "action@github.com"
semantic-release publish
env:
# To generate a new token use the following guide, providing access to the "repo" scope.
# https://docs.github.com/en/enterprise-server@3.4/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
# Once you update the secret on the repo, ensure you update the master/main protected branch policy
# to allow your user permission to "bypass required pull requests".
GH_TOKEN: ${{secrets.GH_TOKEN}}
REPOSITORY_USERNAME: ${{secrets.REPOSITORY_USERNAME}}
REPOSITORY_PASSWORD: ${{secrets.PYPI_PASSWORD}}