Skip to content

Commit 51cb65c

Browse files
authored
Fix issue with release workflow whereby not pushing docker image to docker hub / update versions on all actions (#1589)
* Update all workflows to use latest versions of actions to accomodate deprecation of Node 16; Change how inputs are handled due to changes in the inputs context in guthiub actions. * Add more schedule kickoffs for buildRelease... for testing purposes
1 parent 220c995 commit 51cb65c

File tree

3 files changed

+44
-94
lines changed

3 files changed

+44
-94
lines changed

.github/workflows/buildDocker.yml

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -63,47 +63,21 @@ defaults:
6363

6464
jobs:
6565

66-
######################################################################################
67-
68-
# Regularize the inputs so they can be referenced the same way whether they are
69-
# the result of a workflow_dispatch or a workflow_call
70-
71-
inputs:
72-
runs-on: ubuntu-latest
73-
outputs:
74-
draft: ${{ steps.one.outputs.draft }}
75-
force: ${{ steps.one.outputs.force }}
76-
steps:
77-
- id: one
78-
run: >
79-
if [ '${{ toJSON(inputs) }}' = 'null' ];
80-
then
81-
echo "workflow_dispatch";
82-
echo "draft=${{ github.event.inputs.draft }}" >> $GITHUB_OUTPUT;
83-
echo "force=${{ github.event.inputs.force }}" >> $GITHUB_OUTPUT;
84-
else
85-
echo "workflow_call";
86-
echo "draft=${{ inputs.draft }}" >> $GITHUB_OUTPUT;
87-
echo "force=${{ inputs.force }}" >> $GITHUB_OUTPUT;
88-
fi
89-
90-
9166

9267
######################################################################################
9368

9469
# Use sentry-action to determine if this release has already been built
9570
# based on the latest commit to the repo
9671

9772
sentry:
98-
needs: inputs
9973
runs-on: ubuntu-latest
10074
outputs:
10175
release_not_built: ${{ steps.check.outputs.release_not_built }}
10276

10377
steps:
10478
# Checkout the actions for this repo owner
10579
- name: Checkout Actions
106-
uses: actions/checkout@v3
80+
uses: actions/checkout@v4
10781
with:
10882
repository: ${{ github.repository_owner }}/.github
10983
path: ./Actions_${{ github.sha }}
@@ -127,22 +101,22 @@ jobs:
127101

128102
runs-on: ubuntu-latest
129103

130-
needs: [inputs, sentry]
104+
needs: [sentry]
131105
if: |
132106
needs.sentry.outputs.release_not_built == 'true'
133-
|| needs.inputs.outputs.force == 'true'
107+
|| inputs.force == 'true'
134108
135109
steps:
136110
# Checkout latest commit
137111
- name: Checkout Medley
138-
uses: actions/checkout@v3
112+
uses: actions/checkout@v4
139113

140114
# Find latest release (draft or normal)
141115
# and download its assets
142116
- name: Download linux debs from latest (draft) release
143117
run: |
144118
tag=""
145-
if [ "${{ needs.inputs.outputs.draft }}" = "true" ];
119+
if [ "${{ inputs.draft }}" = "true" ];
146120
then
147121
tag=$(gh release list | grep Draft | head -n 1 | awk '{ print $3 }')
148122
fi
@@ -177,7 +151,7 @@ jobs:
177151
repo_name="${GITHUB_REPOSITORY#*/}"
178152
docker_namespace="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
179153
docker_image="${docker_namespace}/${repo_name}"
180-
if [ "${{ needs.inputs.outputs.draft }}" = "false" ];
154+
if [ "${{ inputs.draft }}" = "false" ];
181155
then
182156
docker_tags="${docker_image}:latest,${docker_image}:${MEDLEY_RELEASE#*-}_${MAIKO_RELEASE#*-}"
183157
platforms="linux/amd64,linux/arm64"
@@ -195,18 +169,18 @@ jobs:
195169
196170
# Setup the Docker Machine Emulation environment.
197171
- name: Set up QEMU
198-
uses: docker/setup-qemu-action@master
172+
uses: docker/setup-qemu-action@v3
199173
with:
200174
platforms: linux/amd64,linux/arm64,linux/arm/v7
201175

202176
# Setup the Docker Buildx funtion
203177
- name: Set up Docker Buildx
204178
id: buildx
205-
uses: docker/setup-buildx-action@master
179+
uses: docker/setup-buildx-action@v3
206180

207181
# Login into DockerHub - required to store the created image
208182
- name: Login to DockerHub
209-
uses: docker/login-action@v2
183+
uses: docker/login-action@v3
210184
with:
211185
username: ${{ secrets.DOCKER_USERNAME }}
212186
password: ${{ secrets.DOCKER_PASSWORD }}
@@ -215,7 +189,7 @@ jobs:
215189
# checked out and the release tars just downloaded.
216190
# Push the result to Docker Hub
217191
- name: Build Docker Image for Push to Docker Hub
218-
uses: docker/build-push-action@v3
192+
uses: docker/build-push-action@v5
219193
with:
220194
builder: ${{ steps.buildx.outputs.name }}
221195
build-args: |
@@ -242,12 +216,12 @@ jobs:
242216
outputs:
243217
build_successful: ${{ steps.output.outputs.build_successful }}
244218

245-
needs: [inputs, sentry, build_and-push]
219+
needs: [sentry, build_and-push]
246220

247221
steps:
248222
# Checkout the actions for this repo owner
249223
- name: Checkout Actions
250-
uses: actions/checkout@v3
224+
uses: actions/checkout@v4
251225
with:
252226
repository: ${{ github.repository_owner }}/.github
253227
path: ./Actions_${{ github.sha }}

.github/workflows/buildLoadup.yml

Lines changed: 29 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -60,46 +60,20 @@ defaults:
6060

6161
jobs:
6262

63-
# JOB: inputs #######################################################################
64-
65-
# Regularize the inputs so they can be referenced the same way whether they are
66-
# the result of a workflow_dispatch or a workflow_call
67-
68-
inputs:
69-
runs-on: ubuntu-latest
70-
outputs:
71-
draft: ${{ steps.one.outputs.draft }}
72-
force: ${{ steps.one.outputs.force }}
73-
steps:
74-
- id: one
75-
run: >
76-
if [ '${{ toJSON(inputs) }}' = 'null' ];
77-
then
78-
echo "workflow_dispatch";
79-
echo "draft=${{ github.event.inputs.draft }}" >> $GITHUB_OUTPUT;
80-
echo "force=${{ github.event.inputs.force }}" >> $GITHUB_OUTPUT;
81-
else
82-
echo "workflow_call";
83-
echo "draft=${{ inputs.draft }}" >> $GITHUB_OUTPUT;
84-
echo "force=${{ inputs.force }}" >> $GITHUB_OUTPUT;
85-
fi
86-
87-
8863
# JOB: sentry #######################################################################
8964

9065
# Use sentry-action to determine if this release has already been built
9166
# based on the latest commit to the repo
9267

9368
sentry:
94-
needs: inputs
9569
runs-on: ubuntu-latest
9670
outputs:
9771
release_not_built: ${{ steps.check.outputs.release_not_built }}
9872

9973
steps:
10074
# Checkout the actions for this repo owner
10175
- name: Checkout Actions
102-
uses: actions/checkout@v3
76+
uses: actions/checkout@v4
10377
with:
10478
repository: ${{ github.repository_owner }}/.github
10579
path: ./Actions_${{ github.sha }}
@@ -133,23 +107,23 @@ jobs:
133107
artifacts_filename_template: ${{ steps.job_outputs.outputs.ARTIFACTS_FILENAME_TEMPLATE }}
134108
release_url: ${{ steps.push.outputs.html_url }}
135109

136-
needs: [inputs, sentry]
110+
needs: [sentry]
137111
if: |
138112
needs.sentry.outputs.release_not_built == 'true'
139-
|| needs.inputs.outputs.force == 'true'
113+
|| inputs.force == 'true'
140114
141115
steps:
142116
# Checkout the actions for this repo owner
143117
- name: Checkout Actions
144-
uses: actions/checkout@v3
118+
uses: actions/checkout@v4
145119
with:
146120
repository: ${{ github.repository_owner }}/.github
147121
path: ./Actions_${{ github.sha }}
148122
- run: mv ./Actions_${{ github.sha }}/actions ../actions && rm -rf ./Actions_${{ github.sha }}
149123

150124
# Checkout latest commit
151125
- name: Checkout Medley
152-
uses: actions/checkout@v3
126+
uses: actions/checkout@v4
153127

154128
# Setup release tag
155129
- name: Setup Release Tag
@@ -163,7 +137,7 @@ jobs:
163137
id: maiko
164138
run: |
165139
tag=""
166-
if [ "${{ needs.inputs.outputs.draft }}" = "true" ];
140+
if [ "${{ inputs.draft }}" = "true" ];
167141
then
168142
gh release list --repo ${{ github.repository_owner }}/maiko | grep Draft >/tmp/releases-$$
169143
if [ $? -eq 0 ];
@@ -219,7 +193,7 @@ jobs:
219193

220194
# Checkout Notecards and tar it in the tarballsdir
221195
- name: Checkout Notecards
222-
uses: actions/checkout@v3
196+
uses: actions/checkout@v4
223197
with:
224198
repository: ${{ github.repository_owner }}/notecards
225199
path: ./notecards
@@ -262,14 +236,14 @@ jobs:
262236
${{ env.TARBALL_DIR }}/${{ env.MEDLEY_RELEASE_TAG }}-loadups.tgz,
263237
${{ env.TARBALL_DIR }}/${{ env.MEDLEY_RELEASE_TAG }}-runtime.tgz
264238
tag: ${{ env.MEDLEY_RELEASE_TAG }}
265-
draft: ${{ needs.inputs.outputs.draft }}
239+
draft: ${{ inputs.draft }}
266240
prerelease: false
267241
generateReleaseNotes: true
268242
token: ${{ secrets.GITHUB_TOKEN }}
269243

270244
# Save the tarball directory for subsequent jobs
271245
- name: Save tarballs
272-
uses: actions/upload-artifact@v3
246+
uses: actions/upload-artifact@v4
273247
with:
274248
name: tarballs
275249
path: ${{ env.TARBALL_DIR }}
@@ -285,16 +259,16 @@ jobs:
285259

286260
runs-on: ubuntu-latest
287261

288-
needs: [inputs, sentry, loadup]
262+
needs: [sentry, loadup]
289263
if: |
290264
needs.sentry.outputs.release_not_built == 'true'
291-
|| needs.inputs.outputs.force == 'true'
265+
|| inputs.force == 'true'
292266
293267
steps:
294268

295269
# Checkout latest commit
296270
- name: Checkout Medley
297-
uses: actions/checkout@v3
271+
uses: actions/checkout@v4
298272

299273
# Environment variables
300274
- name: Environment variables
@@ -311,7 +285,7 @@ jobs:
311285

312286
# Get the tarballs
313287
- name: Get tarballs
314-
uses: actions/download-artifact@v3
288+
uses: actions/download-artifact@v4
315289
with:
316290
name: tarballs
317291
path: ${{ env.TARBALL_DIR }}
@@ -345,7 +319,7 @@ jobs:
345319
mv medley-full-linux-x86_64-*.tgz medley.tgz
346320
347321
- name: Save medley tar for use in cygwin installers
348-
uses: actions/upload-artifact@v3
322+
uses: actions/upload-artifact@v4
349323
with:
350324
name: medley-tar
351325
path: |
@@ -361,10 +335,10 @@ jobs:
361335

362336
runs-on: macos-12
363337

364-
needs: [inputs, sentry, loadup]
338+
needs: [sentry, loadup]
365339
if: |
366340
needs.sentry.outputs.release_not_built == 'true'
367-
|| needs.inputs.outputs.force == 'true'
341+
|| inputs.force == 'true'
368342
# if: false
369343

370344
defaults:
@@ -375,7 +349,7 @@ jobs:
375349

376350
# Checkout latest commit
377351
- name: Checkout Medley
378-
uses: actions/checkout@v3
352+
uses: actions/checkout@v4
379353

380354
# Environment variables
381355
- name: Environment variables
@@ -392,7 +366,7 @@ jobs:
392366

393367
# Get the tarballs
394368
- name: Get tarballs
395-
uses: actions/download-artifact@v3
369+
uses: actions/download-artifact@v4
396370
with:
397371
name: tarballs
398372
path: ${{ env.TARBALL_DIR }}
@@ -432,10 +406,10 @@ jobs:
432406

433407
runs-on: windows-2022
434408

435-
needs: [inputs, sentry, loadup, linux_installer]
409+
needs: [sentry, loadup, linux_installer]
436410
if: |
437411
needs.sentry.outputs.release_not_built == 'true'
438-
|| needs.inputs.outputs.force == 'true'
412+
|| inputs.force == 'true'
439413
440414
outputs:
441415
cygwin_installer: ${{ steps.compile_iss.outputs.CYGWIN_INSTALLER }}
@@ -444,7 +418,7 @@ jobs:
444418

445419
# Checkout latest commit
446420
- name: Checkout Medley
447-
uses: actions/checkout@v3
421+
uses: actions/checkout@v4
448422

449423
# Store the values output from loadup job as environment variables
450424
- name: Environment Variables
@@ -463,7 +437,7 @@ jobs:
463437
464438
# Retrieve medley tars from artifact store
465439
- name: Retrieve medley tar
466-
uses: actions/download-artifact@v3
440+
uses: actions/download-artifact@v4
467441
with:
468442
name: medley-tar
469443
path: installers/cygwin/
@@ -535,10 +509,10 @@ jobs:
535509

536510
runs-on: ubuntu-latest
537511

538-
needs: [inputs, sentry, loadup, linux_installer, macos_installer, cygwin_installer]
512+
needs: [sentry, loadup, linux_installer, macos_installer, cygwin_installer]
539513
if: |
540514
needs.sentry.outputs.release_not_built == 'true'
541-
|| needs.inputs.outputs.force == 'true'
515+
|| inputs.force == 'true'
542516
543517
steps:
544518

@@ -556,7 +530,7 @@ jobs:
556530
557531
# Checkout latest commit
558532
- name: Checkout Medley
559-
uses: actions/checkout@v3
533+
uses: actions/checkout@v4
560534

561535

562536
# Upload a dummy file to release
@@ -587,7 +561,7 @@ jobs:
587561
local_template="installers/downloads_page/medley_downloads.html"
588562
local_filename="medley_downloads.html"
589563
local_manpath="docs/man-page/man_medley.html"
590-
if [ "${{ needs.inputs.outputs.draft }}" = "true" ];
564+
if [ "${{ inputs.draft }}" = "true" ];
591565
then
592566
remote_filename="draft_downloads"
593567
remote_manname="man_draft.html"
@@ -637,19 +611,19 @@ jobs:
637611
outputs:
638612
build_successful: ${{ steps.output.outputs.build_successful }}
639613

640-
needs: [inputs, sentry, loadup, downloads_page]
614+
needs: [sentry, loadup, downloads_page]
641615

642616
steps:
643617
# Delete the tarballs artifact
644618
- name: Delete tarballs artifact
645-
uses: geekyeggo/delete-artifact@v2
619+
uses: geekyeggo/delete-artifact@v5
646620
with:
647621
name: tarballs
648622
failOnError: false
649623

650624
# Checkout the actions for this repo owner
651625
- name: Checkout Actions
652-
uses: actions/checkout@v3
626+
uses: actions/checkout@v4
653627
with:
654628
repository: ${{ github.repository_owner }}/.github
655629
path: ./Actions_${{ github.sha }}

0 commit comments

Comments
 (0)