diff --git a/.github/workflows/publish-reusable.yml b/.github/workflows/publish-reusable.yml index 98ae9e7..5c06513 100644 --- a/.github/workflows/publish-reusable.yml +++ b/.github/workflows/publish-reusable.yml @@ -16,7 +16,11 @@ on: required: true type: string environment_name: - description: 'Name of environment that specifies PyPI/TestPyPI url' + description: 'Name for PyPI/TestPyPI environment' + type: string + required: true + environment_url: + description: 'URL for PyPI/TestPyPI environment' type: string required: true secrets: @@ -31,7 +35,9 @@ jobs: publish: name: Build runs-on: ubuntu-latest - environment: ${{ inputs.environment_name }} + environment: + name: ${{ inputs.environment_name }} + url: ${{ inputs.environment_url }} env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} GITHUB_REPO: ${{ github.repository }} diff --git a/.github/workflows/publish-to-testpypi.yaml b/.github/workflows/publish-to-testpypi.yaml index c6a0c1d..9f568d5 100644 --- a/.github/workflows/publish-to-testpypi.yaml +++ b/.github/workflows/publish-to-testpypi.yaml @@ -4,24 +4,23 @@ on: workflow_dispatch: inputs: version: - description: 'Version name for release' + description: 'Version name for release. Must start with: "test-release-".' required: true + jobs: publish: name: Publish wheel to TestPyPI - runs-on: ubuntu-latest - environment: - name: testpypi - url: https://test.pypi.org/p/seclab-taskflow-agent2 permissions: contents: write id-token: write # For trusted publishing - uses: .github/workflows/publish-reusable.yml@main + if: startsWith(inputs.version, 'test-release-') + uses: ./.github/workflows/publish-reusable.yml with: version: ${{ inputs.version }} release_notes: ${{ github.head_ref }} repository_url: https://test.pypi.org/legacy/ - environment: testpypi + environment_name: testpypi + environment_url: https://test.pypi.org/p/seclab-taskflow-agent2 secrets: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}