Skip to content

fix: global env variables access #4

fix: global env variables access

fix: global env variables access #4

Workflow file for this run

name: Build and publish on version tag
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
branches: [main]
env:
TOKEN: ${{ secrets.PYPI_TOKEN }}
PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TAG_VERSION: ${{ github.ref_name }}
jobs:
build:
runs-on: ubuntu-latest
env:
VERSION: ${{ env.TAG_VERSION }}

Check failure on line 19 in .github/workflows/publish.yaml

View workflow run for this annotation

GitHub Actions / Build and publish on version tag

Invalid workflow file

The workflow is not valid. .github/workflows/publish.yaml (Line: 19, Col: 16): Unrecognized named-value: 'env'. Located at position 1 within expression: env.TAG_VERSION .github/workflows/publish.yaml (Line: 63, Col: 15): Unrecognized named-value: 'TAG_VERSION'. Located at position 1 within expression: TAG_VERSION
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Build package
run: |
poetry version ${VERSION#v}
poetry build
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
retention-days: 1
publish:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Download archive
uses: actions/download-artifact@v4
- name: Config repository
run: |
poetry config pypi-token.pypi ${{ env.TOKEN }}
poetry config http-basic.pypi multi_coop ${{ env.PASSWORD }}
- name: Publish ${{ TAG_VERSION }}
run: poetry publish