Skip to content

Commit fa46962

Browse files
Merge pull request #53 from kevinbackhouse/fix-publish-workflow-v2
Attempt to fix the publish workflow
2 parents 764e39e + 88cd106 commit fa46962

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

.github/workflows/publish-reusable.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ on:
1616
required: true
1717
type: string
1818
environment_name:
19-
description: 'Name of environment that specifies PyPI/TestPyPI url'
19+
description: 'Name for PyPI/TestPyPI environment'
20+
type: string
21+
required: true
22+
environment_url:
23+
description: 'URL for PyPI/TestPyPI environment'
2024
type: string
2125
required: true
2226
secrets:
@@ -31,7 +35,9 @@ jobs:
3135
publish:
3236
name: Build
3337
runs-on: ubuntu-latest
34-
environment: ${{ inputs.environment_name }}
38+
environment:
39+
name: ${{ inputs.environment_name }}
40+
url: ${{ inputs.environment_url }}
3541
env:
3642
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
3743
GITHUB_REPO: ${{ github.repository }}

.github/workflows/publish-to-testpypi.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,23 @@ on:
44
workflow_dispatch:
55
inputs:
66
version:
7-
description: 'Version name for release'
7+
description: 'Version name for release. Must start with: "test-release-".'
88
required: true
99

10+
1011
jobs:
1112
publish:
1213
name: Publish wheel to TestPyPI
13-
runs-on: ubuntu-latest
14-
environment:
15-
name: testpypi
16-
url: https://test.pypi.org/p/seclab-taskflow-agent2
1714
permissions:
1815
contents: write
1916
id-token: write # For trusted publishing
20-
uses: .github/workflows/publish-reusable.yml@main
17+
if: startsWith(inputs.version, 'test-release-')
18+
uses: ./.github/workflows/publish-reusable.yml
2119
with:
2220
version: ${{ inputs.version }}
2321
release_notes: ${{ github.head_ref }}
2422
repository_url: https://test.pypi.org/legacy/
25-
environment: testpypi
23+
environment_name: testpypi
24+
environment_url: https://test.pypi.org/p/seclab-taskflow-agent2
2625
secrets:
2726
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)