Skip to content

feat: add ability to set PYTHON_VERSION via variables #1

feat: add ability to set PYTHON_VERSION via variables

feat: add ability to set PYTHON_VERSION via variables #1

name: publish-node-python

Check failure on line 1 in .github/workflows/publish-node-python.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/publish-node-python.yml

Invalid workflow file

(Line: 24, Col: 19): Unexpected symbol: '"3'. Located at position 24 within expression: vars.PYTHON_VERSION || "3.10"
on:
workflow_call:
secrets:
PYPI_USERNAME:
required: true
PYPI_PASSWORD:
required: true
NPM_TOKEN:
required: true
DATAVISYN_BOT_REPO_TOKEN:
required: false
NODE_VERSION:
required: false
PYTHON_VERSION:
required: false
env:
NODE_VERSION: "20.9"
NPM_REGISTRY: "https://registry.npmjs.org/"
PYPI_REGISTRY: "https://upload.pypi.org/legacy/"
PYPI_USERNAME: "datavisyn"
PYTHON_VERSION: ${{ vars.PYTHON_VERSION || "3.10" }}
WORKFLOW_BRANCH: "main"
permissions:
contents: read
concurrency:
group: '${{ github.workflow }}-${{ github.ref || github.head_ref }}'
cancel-in-progress: true
jobs:
publish-node:
permissions:
id-token: write
contents: read
runs-on: ubuntu-22.04
steps:
- name: check branch
if: ${{ github.ref_name != 'main' }}
run: |
echo "only the main branch can be published."
exit 1
# checkout specific source repository
- uses: actions/checkout@v4
with:
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }} # has to set because otherwise it will not work
# checkout this workflow repository to get actions
- uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
path: ./tmp/github-workflows
- uses: ./tmp/github-workflows/.github/actions/check-actor
with:
dv_devops: ${{ vars.DV_DEVOPS }}
allowed_users: ${{ vars.DV_CAN_RELEASE }}
actor: ${{ github.actor }}
qms_are_allowed: "false"
- uses: ./tmp/github-workflows/.github/actions/build-node-python
with:
enable_node: true
enable_python: false
node_version: ${{ secrets.NODE_VERSION || env.NODE_VERSION }}
npm_registry: ${{ env.NPM_REGISTRY }}
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
- uses: ./tmp/github-workflows/.github/actions/publish-node
with:
npm_token: ${{ secrets.NPM_TOKEN }}
publish-python:
runs-on: ubuntu-22.04
steps:
- name: check branch
if: ${{ github.ref_name != 'main' }}
run: |
echo "only the main branch can be published."
exit 1
# checkout specific source repository
- uses: actions/checkout@v4
# checkout this workflow repository to get actions
- uses: actions/checkout@v4
with:
repository: datavisyn/github-workflows
ref: ${{ env.WORKFLOW_BRANCH }}
path: ./tmp/github-workflows
- uses: ./tmp/github-workflows/.github/actions/check-actor
with:
dv_devops: ${{ vars.DV_DEVOPS }}
allowed_users: ${{ vars.DV_CAN_RELEASE }}
actor: ${{ github.actor }}
qms_are_allowed: "false"
- uses: ./tmp/github-workflows/.github/actions/build-node-python
with:
enable_node: false
enable_python: true
python_version: ${{ secrets.PYTHON_VERSION || env.PYTHON_VERSION }}
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
- uses: ./tmp/github-workflows/.github/actions/publish-python
with:
pypi_registry: ${{ env.PYPI_REGISTRY }}
pypi_username: ${{ secrets.PYPI_USERNAME }}
pypi_password: ${{ secrets.PYPI_PASSWORD }}