Skip to content

gha: update actions to account for node 16 deprecation #47250

Merged
thaJeztah merged 9 commits intomoby:masterfrom
thaJeztah:update_actions
Jan 31, 2024
Merged

gha: update actions to account for node 16 deprecation #47250
thaJeztah merged 9 commits intomoby:masterfrom
thaJeztah:update_actions

Conversation

@thaJeztah
Copy link
Member

Noticed deprecation warnings in CI:

Please update the following actions to use Node.js 20: actions/checkout@v3, actions/github-script@v6. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

⚠️ I did not update the actions below; but I think these had compatibility issues:

  • actions/upload-artifact@v3
  • actions/download-artifact@v3
  • actions/cache@v3

gha: update to actions/checkout@v4

Release notes:

gha: update to actions/github-script@v7

breaking changes: https://github.com/actions/github-script?tab=readme-ov-file#v7

Version 7 of this action updated the runtime to Node 20
https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-javascript-actions

All scripts are now run with Node 20 instead of Node 16 and are affected
by any breaking changes between Node 16 and 20

The previews input now only applies to GraphQL API calls as REST API previews
are no longer necessary
https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/.

gha: update to actions/setup-go@v5

v5

In scope of this release, we change Nodejs runtime from node16 to node20.
Moreover, we update some dependencies to the latest versions.

Besides, this release contains such changes as:

  • Fix hosted tool cache usage on windows
  • Improve documentation regarding dependencies caching

V4

The V4 edition of the action offers:

  • Enabled caching by default
  • The action will try to enable caching unless the cache input is explicitly
    set to false.

Please see "Caching dependency files and build outputs" for more information:
https://github.com/actions/setup-go#caching-dependency-files-and-build-outputs

gha: update to docker/metadata-action@v5

gha: update to docker/setup-buildx-action@v3

gha: update to docker/bake-action@v4

gha: update to docker/setup-qemu-action@v3

gha: update to docker/login-action@v3

gha: update to crazy-max/ghaction-github-runtime@v3

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah
Copy link
Member Author

thaJeztah commented Jan 30, 2024

Looks like some changes are needed;

Run mv "cwd:///home/runner/work/_temp/docker-actions-toolkit-tAvNLJ/docker-metadata-action-bake.json" "/tmp/bake-meta.json"
mv: cannot stat 'cwd:///home/runner/work/_temp/docker-actions-toolkit-tAvNLJ/docker-metadata-action-bake.json': No such file or directory
Error: Process completed with exit code 1.

mv "${{ steps.meta.outputs.bake-file }}" "/tmp/bake-meta.json"

docker buildx imagetools create $(jq -cr '.target."docker-metadata-action".tags | map("-t " + .) | join(" ")' /tmp/bake-meta.json) \
$(printf '${{ env.MOBYBIN_REPO_SLUG }}@sha256:%s ' *)
-
name: Inspect image
run: |
set -x
docker buildx imagetools inspect ${{ env.MOBYBIN_REPO_SLUG }}:$(jq -cr '.target."docker-metadata-action".args.DOCKER_META_VERSION' /tmp/bake-meta.json)

@crazy-max
Copy link
Member

Looks like some changes are needed;

Run mv "cwd:///home/runner/work/_temp/docker-actions-toolkit-tAvNLJ/docker-metadata-action-bake.json" "/tmp/bake-meta.json"
mv: cannot stat 'cwd:///home/runner/work/_temp/docker-actions-toolkit-tAvNLJ/docker-metadata-action-bake.json': No such file or directory
Error: Process completed with exit code 1.

mv "${{ steps.meta.outputs.bake-file }}" "/tmp/bake-meta.json"

docker buildx imagetools create $(jq -cr '.target."docker-metadata-action".tags | map("-t " + .) | join(" ")' /tmp/bake-meta.json) \
$(printf '${{ env.MOBYBIN_REPO_SLUG }}@sha256:%s ' *)
-
name: Inspect image
run: |
set -x
docker buildx imagetools inspect ${{ env.MOBYBIN_REPO_SLUG }}:$(jq -cr '.target."docker-metadata-action".args.DOCKER_META_VERSION' /tmp/bake-meta.json)

Ah yes this is related to docker/metadata-action#381, see docker/metadata-action#381 (comment) as workaround in the meantime

Release notes:

- actions/checkout@v3.6.0...v4.1.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- full diff: actions/github-script@v6.4.1...v7.0.1

breaking changes: https://github.com/actions/github-script?tab=readme-ov-file#v7

> Version 7 of this action updated the runtime to Node 20
> https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-javascript-actions
>
> All scripts are now run with Node 20 instead of Node 16 and are affected
> by any breaking changes between Node 16 and 20
>
> The previews input now only applies to GraphQL API calls as REST API previews
> are no longer necessary
> https://github.blog/changelog/2021-10-14-rest-api-preview-promotions/.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- full diff: actions/setup-go@v3.5.0...v5.0.0

v5

In scope of this release, we change Nodejs runtime from node16 to node20.
Moreover, we update some dependencies to the latest versions.

Besides, this release contains such changes as:

- Fix hosted tool cache usage on windows
- Improve documentation regarding dependencies caching

V4

The V4 edition of the action offers:

- Enabled caching by default
- The action will try to enable caching unless the cache input is explicitly
  set to false.

Please see "Caching dependency files and build outputs" for more information:
https://github.com/actions/setup-go#caching-dependency-files-and-build-outputs

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- Node 20 as default runtime (requires Actions Runner v2.308.0 or later)
- full diff: docker/metadata-action@v4.6.0...v5.5.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- Node 20 as default runtime (requires Actions Runner v2.308.0 or later)
- full diff: docker/setup-buildx-action@v2.10.0...v3.0.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- Node 20 as default runtime (requires Actions Runner v2.308.0 or later)
- full diff docker/bake-action@v2.3.0...v4.1.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- Node 20 as default runtime (requires Actions Runner v2.308.0 or later)
- full diff docker/setup-qemu-action@v2.2.0...v3.0.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- Node 20 as default runtime (requires Actions Runner v2.308.0 or later)
- full diff docker/login-action@v2.2.0...v3.0.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- Node 20 as default runtime (requires Actions Runner v2.308.0 or later)
- full diff: crazy-max/ghaction-github-runtime@v2.2.0...v3.0.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Comment on lines 63 to +67
name: Rename meta bake definition file
# see https://github.com/docker/metadata-action/issues/381#issuecomment-1918607161
run: |
mv "${{ steps.meta.outputs.bake-file }}" "/tmp/bake-meta.json"
bakeFile="${{ steps.meta.outputs.bake-file }}"
mv "${bakeFile#cwd://}" "/tmp/bake-meta.json"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this commit to have the suggested changes

@thaJeztah
Copy link
Member Author

Thanks @crazy-max - looks like that resolved the issue; PTAL 🤗

@thaJeztah
Copy link
Member Author

Looks like the remaining warnings are for the upload- and download-artifact actions; let's do those in a follow-up (as additional changes may be needed for that one?)

Screenshot 2024-01-31 at 11 48 23

@crazy-max
Copy link
Member

crazy-max commented Jan 31, 2024

Looks like the remaining warnings are for the upload- and download-artifact actions; let's do those in a follow-up (as additional changes may be needed for that one?)
Screenshot 2024-01-31 at 11 48 23

Yes will do the artifact actions bump in follow-up

@thaJeztah
Copy link
Member Author

Let me bring this one in; thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants