build and publish #7
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
# This workflows will upload a Python Package using Twine when a release is created | |
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | |
name: build and publish | |
on: | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
test3d: | |
uses: equinor/warmth/.github/workflows/python-test-3d.yml@main | |
with: | |
event_type: ${{ github.event_name}} | |
action_type: ${{ github.event.action}} | |
test1d: | |
uses: equinor/warmth/.github/workflows/python-test.yml@main | |
with: | |
event_type: ${{ github.event_name}} | |
action_type: ${{ github.event.action}} | |
snyk: | |
uses: equinor/warmth/.github/workflows/snyk.yml@main | |
secrets: | |
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | |
GITHUB_TOKEN_WORKFLOW: ${{ secrets.GITHUB_TOKEN }} | |
docs: | |
uses: equinor/warmth/.github/workflows/docs.yml@main | |
secrets: | |
GITHUB_TOKEN_WORKFLOW: ${{ secrets.GITHUB_TOKEN }} | |
deploy: | |
needs: [test3d, test1d, snyk, docs] | |
environment: deploy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: 'main' | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' | |
- name: Azure key vault login | |
uses: Azure/login@v1 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
allow-no-subscriptions: true | |
- name: Fetch secrets | |
uses: azure/CLI@v1 | |
with: | |
azcliversion: 2.42.0 | |
inlineScript: | | |
echo PYPI_TOKEN=$(az keyvault secret show --vault-name PSSCloudDev --name PYPI-Token --query value -o tsv) >> $GITHUB_ENV | |
- name: Install dependencies | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 | |
poetry install --with dev --no-interaction | |
- name: Build and publish | |
run: | | |
poetry config pypi-token.pypi ${{ env.PYPI_TOKEN }} | |
poetry build | |
poetry publish |