Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update action versions and standards #41

Merged
merged 9 commits into from
Sep 18, 2024
Merged

Conversation

tagoro9
Copy link
Contributor

@tagoro9 tagoro9 commented Sep 16, 2024

Description

This PR aims to update this repo to use workflows closer to those of actions-node.

Main changes:

  • Pin action-docs version and make it work
  • Update several outdated actions
  • Use semantic-release instead of go-semantic-release
  • Update release workflow
  • Update prerelease to add comments as well as only trigger based on labels. Apart from this, I updated the action to leverage goreleaser to push docker images, since now prerelease will generate an RC like version when running on pull requests, meaning that we no longer need to manually push tags. In order for this to work, we have to set create-prerelease to true in a consumer, so that a new tag is created and so that goreleaser has a version to work with. This will create a draft release for every prerelease, but that should be ok, since for non docker releases, goreleaser needs to add the binaries to a release.

TODOs

  • Address code TODOs
  • Update the action CI itself (renovatebot, missing workflows, pre-commit, ...)
  • Remove the need for the go-version input
  • Ensure the action succeeds when no release is created (go releaser is failing right now)
  • The docker image comment is not showing the correct info
  • Reword commits

How has this been tested?

Internally in some libs shared with the reviewers of this PR

Changes

  • feat: update release and prelease to our standards
  • ci: trigger on main and remove not needed token
  • docs: ensure action-docs works correctly
  • ci: ignore action-docs output for trim whitespace
  • fix(test): update deps
  • fix(lint): update deps
  • fix(deps): use actions-setup-tools@v2
  • build: pin action-docs major version

🚀 PR created with fotingo

@tagoro9 tagoro9 force-pushed the f/modernize_actions_go branch from 98cc97b to cc99a02 Compare September 16, 2024 20:56
outputs:
version:
description: Version of the project
value: ${{ steps.release.outputs.version }}
runs:
using: composite
steps:
- name: Set vars
Copy link
Contributor Author

@tagoro9 tagoro9 Sep 16, 2024

Choose a reason for hiding this comment

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

Here there is a lot of logic that we are duplicating from actions-node and actions-java. I'm sure there is a better way to not DRY these things (not to be done in this PR)

@tagoro9 tagoro9 force-pushed the f/modernize_actions_go branch 3 times, most recently from 41f5ada to 548acfb Compare September 16, 2024 22:26
prerelease/action.yaml Outdated Show resolved Hide resolved
@tagoro9 tagoro9 force-pushed the f/modernize_actions_go branch from 548acfb to 3deabc4 Compare September 16, 2024 23:39
@tagoro9 tagoro9 requested a review from yohanb September 16, 2024 23:55
@yohanb
Copy link
Contributor

yohanb commented Sep 17, 2024

when building and pushing a prerelease docker image, isn't that going to override the latest tag as well?

@tagoro9
Copy link
Contributor Author

tagoro9 commented Sep 17, 2024

when building and pushing a prerelease docker image, isn't that going to override the latest tag as well?

Oh I haven't checked that. We don't use the latest tag though. I'll do some more testing and ensure that prereleases stay as draft releases

@tagoro9 tagoro9 force-pushed the f/modernize_actions_go branch 10 times, most recently from fabbdec to d8b7007 Compare September 18, 2024 20:15
prerelease label, use semantic-release, remove go-version and push docker-snapshot

BREAKING CHANGE: The `go-version` and `push-docker-snapshot` inputs no
longer exist in the `release` and `reprelease` actions
@tagoro9 tagoro9 force-pushed the f/modernize_actions_go branch from d8b7007 to 73840ba Compare September 18, 2024 20:22
@tagoro9 tagoro9 marked this pull request as ready for review September 18, 2024 20:24
@tagoro9 tagoro9 requested a review from a team as a code owner September 18, 2024 20:24
Copy link
Contributor

@yohanb yohanb left a comment

Choose a reason for hiding this comment

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

Awesome! Just added a few comments, nothing critical.
Thanks for the work on this.

docs/breaking-changes/v3.md Outdated Show resolved Hide resolved
prerelease/action.yaml Outdated Show resolved Hide resolved
release/action.yaml Outdated Show resolved Hide resolved
npx action-docs --no-banner --source "${i}" --update-readme "${readme_file}"

echo "npx action-docs --no-banner -s "${i}""
cd $(dirname "$i")
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@tagoro9 tagoro9 force-pushed the f/modernize_actions_go branch from 27898d8 to 2d8ca32 Compare September 18, 2024 21:45
Copy link

github-actions bot commented Sep 18, 2024

Release notes preview

Below is a preview of the release notes if your PR gets merged.


3.0.0 (2024-09-18)

⚠ BREAKING CHANGES

  • The go-version and push-docker-snapshot inputs no
    longer exist in the release and reprelease actions

Features

  • update release and prelease to our standards (73840ba)

Bug Fixes

Build System

  • pin action-docs major version (be0e6a4)

Continuous Integration

  • ignore action-docs output for trim whitespace (80ca20f)
  • trigger on main and remove not needed token (23a3b85)

Documentation

  • ensure action-docs works correctly (acef6cd)
  • fix some typos (2d8ca32)
  • update usage of action-docs and main README.md for all actions (06fb950)
  • prerelease: update usage of action-docs and main README.md (48fb1a2)

Breaking changes file docs/breaking-changes/v3.md

Breaking changes in v3

The go-version input in the release and prerelease actions no longer exists.

The action will use the installed version in the runner.

The push-docker-snapshot input in the prerelease action no longer exists. Instead, set the create-prerelease input to true.


@tagoro9 tagoro9 merged commit 5eb4502 into main Sep 18, 2024
2 checks passed
@tagoro9 tagoro9 deleted the f/modernize_actions_go branch September 18, 2024 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants