Skip to content

Commit 0043c26

Browse files
run test suite instead of reading most recent run on release (#99)
1 parent 52463b2 commit 0043c26

File tree

2 files changed

+6
-27
lines changed

2 files changed

+6
-27
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
2525
### Changed
2626

2727
- Reworded two headers in the template README to better reflect their purpose.
28+
- When cutting a release via `release.yml` GitHub Action workflow, run test suite before publishing package to PyPI. Previously the CLI tools `gh` and `jq` were used to check the most recent run of the test suite.
2829

2930
### Removed
3031

src/django_twc_package/.github/workflows/release.yml.jinja

+5-27
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,12 @@ on:
44
release:
55
types: [released]
66

7-
jobs:
8-
check:
9-
runs-on: ubuntu-latest
10-
permissions:
11-
actions: read
12-
contents: read
13-
env:
14-
GH_TOKEN: ${% raw %}{{ secrets.GITHUB_TOKEN }}{% endraw %}
15-
steps:
16-
- uses: actions/checkout@v4
17-
18-
- name: Check most recent test run on `main`
19-
id: latest-test-result
20-
run: |
21-
echo "result=$(gh run list \
22-
--branch=main \
23-
--workflow=test.yml \
24-
--json headBranch,workflowName,conclusion \
25-
--jq '.[] | select(.headBranch=="main" and .conclusion=="success") | .conclusion' \
26-
| head -n 1)" >> $GITHUB_OUTPUT
7+
permissions:
8+
contents: write
279

28-
- name: OK
29-
if: ${% raw %}{{ (contains(steps.latest-test-result.outputs.result, 'success')) }}{% endraw %}
30-
run: exit 0
31-
32-
- name: Fail
33-
if: ${% raw %}{{ !contains(steps.latest-test-result.outputs.result, 'success') }}{% endraw %}
34-
run: exit 1
10+
jobs:
11+
test:
12+
uses: ./.github/workflows/test.yml
3513

3614
pypi:
3715
if: ${% raw %}{{ github.event_name == 'release' }}{% endraw %}

0 commit comments

Comments
 (0)