Skip to content

Commit 4464d09

Browse files
committed
workflow: clean-up and actions-upgrade
1 parent 815cc8b commit 4464d09

File tree

2 files changed

+28
-19
lines changed

2 files changed

+28
-19
lines changed

.github/workflows/build-pyz.yml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
types:
88
- published
99

10+
# release published by workflow does not trigger above event;
11+
# rather, we're triggered by this below
1012
workflow_run:
1113
workflows:
1214
- publish
@@ -27,36 +29,43 @@ jobs:
2729

2830
outputs:
2931
release-sha: ${{ steps.head.outputs.release-sha }}
30-
can-build: ${{ steps.success.outputs.can-build }}
32+
can-build: ${{ steps.upstream.outputs.can-build }}
3133

3234
steps:
33-
- name: Check success
34-
id: success
35+
- name: Check upstream success
36+
id: upstream
3537
env:
36-
CONCLUSION: ${{ github.event.workflow_run && github.event.workflow_run.conclusion || 'success' }}
38+
CONCLUSION: ${{ github.event.workflow_run && github.event.workflow_run.conclusion || 'na' }}
3739
run: |
38-
if [ "$CONCLUSION" = success ]
39-
then
40-
echo "publish successful"
41-
echo "can-build=true" >> $GITHUB_OUTPUT
42-
else
43-
echo "::error::publish not successful"
44-
echo "can-build=false" >> $GITHUB_OUTPUT
45-
fi
40+
case "$CONCLUSION" in
41+
success)
42+
echo "upstream publish successful"
43+
echo "can-build=true" >> $GITHUB_OUTPUT
44+
;;
45+
na)
46+
echo "no upstream workflow"
47+
echo "can-build=true" >> $GITHUB_OUTPUT
48+
;;
49+
*)
50+
echo "::notice::upstream publish unsuccessful"
51+
echo "can-build=false" >> $GITHUB_OUTPUT
52+
;;
53+
esac
4654
4755
- name: Check out repository
48-
uses: actions/checkout@v3
49-
if: fromJSON(steps.success.outputs.can-build)
56+
uses: actions/checkout@v4
57+
if: fromJSON(steps.upstream.outputs.can-build)
5058
with:
5159
# fetch enough that we should feasibly be able to find this changeset
5260
# and its subsequent tag commit (but without fetching *everything*)
5361
ref: ${{ github.event.workflow_run.head_branch }}
5462
fetch-depth: 100
63+
# fetch tags s.t. we can interpret ref inputs on dispatch
5564
fetch-tags: true
5665

5766
- name: Determine HEAD
5867
id: head
59-
if: fromJSON(steps.success.outputs.can-build)
68+
if: fromJSON(steps.upstream.outputs.can-build)
6069
env:
6170
HEAD_REF: ${{ inputs.head-ref }}
6271
RUN_SHA: ${{ github.event.workflow_run.head_sha }}
@@ -92,7 +101,7 @@ jobs:
92101
93102
delegate:
94103
needs: [setup]
95-
uses: internet-equity/fate-pyz/.github/workflows/build-pyz.yml@0.6.7
104+
uses: internet-equity/fate-pyz/.github/workflows/build-pyz.yml@0.6.8
96105
if: fromJSON(needs.setup.outputs.can-build)
97106
permissions:
98107
contents: write

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
type: boolean
1717
required: false
1818
draft:
19-
description: draft but do not publish release (dependent jobs will fail)
19+
description: draft but do not publish release (dependent jobs may fail)
2020
type: boolean
2121
required: false
2222
prerelease:
@@ -67,7 +67,7 @@ jobs:
6767

6868
steps:
6969
- name: Check out repository
70-
uses: actions/checkout@v3
70+
uses: actions/checkout@v4
7171
with:
7272
#
7373
# Fetch ALL history s.t. tags may be sorted by date (creatordate)
@@ -195,7 +195,7 @@ jobs:
195195
fi
196196
197197
- name: Check out repository
198-
uses: actions/checkout@v3
198+
uses: actions/checkout@v4
199199

200200
- name: Install management dependencies
201201
run: pip install poetry

0 commit comments

Comments
 (0)