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

Add new build Action #280

Merged
merged 2 commits into from
Nov 19, 2024
Merged

Add new build Action #280

merged 2 commits into from
Nov 19, 2024

Conversation

bbasata
Copy link
Contributor

@bbasata bbasata commented Nov 19, 2024

This change adds a new build Action while keeping the current release Action intact. The intent is to incrementally gain confidence in the new Action by operating both workflows in parallel for some time.

Any builds generated by this Action will simply be uploaded as Actions artifacts and go nowhere beyond that.

The new build Action is, in fact, not entirely new. See prior art in Terraform Core and other repos. Here are a few benefits for official Terraform providers:

  • Matrixed Go builds
  • Single responsibility -- build-only, rather than build and release
  • ZIP archives uploaded as GitHub Actions artifacts for further processing by other Actions

This change adds a new build Action while keeping the current release
Action intact. The intent is to incrementally gain confidence in the new
Action by operating both workflows in parallel for some time.

The new build Action is, in fact, not entirely new. See prior art in
[Terraform
Core](https://github.com/hashicorp/terraform/blob/main/.github/workflows/build.yml)
and other repos. Here are a few benefits for official Terraform
providers:

* Matrixed Go builds
* Single responsibility -- build-only, rather than build and release
* ZIP archives uploaded as GitHub Actions artifacts for further
  processing by other Actions
@bbasata bbasata requested a review from a team as a code owner November 19, 2024 14:11
Copy link

hashicorp-cla-app bot commented Nov 19, 2024

CLA assistant check
All committers have signed the CLA.

@bbasata bbasata enabled auto-merge (squash) November 19, 2024 15:54
@hashicorp hashicorp deleted a comment from hashicorp-cla-app bot Nov 19, 2024
Copy link
Member

@austinvalle austinvalle left a comment

Choose a reason for hiding this comment

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

LGTM, great step forward 🚀

Comment on lines +30 to +36
# We use .go-version as our source of truth for current Go
# version, because "goenv" can react to it automatically.
# Specify the exact Go version (e.g., 1.22.4) in .go-version
# if your build requires a specific patch version of Go.
# Otherwise, specify the major and minor versions (e.g., 1.22),
# with a caveat that it can lead to builds using different
# patch versions of Go in a workflow run.
Copy link
Member

Choose a reason for hiding this comment

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

Interesting! I wonder if now that the Go toolchain defaults to including patch version details in the go.mod, if we really need this static file in the future 🤔

- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Set Product version
id: set-product-version
uses: hashicorp/actions-set-product-version@v1
Copy link
Member

@austinvalle austinvalle Nov 19, 2024

Choose a reason for hiding this comment

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

nit: in the future we should probably point their actions to the commit hash (also noticed they have a v2 that their example is not updated to use 😆 )

Our internal tool TSCCR doesn't support pinning/upgrading hashicorp actions for us 🙃
https://github.com/hashicorp/security-tsccr/issues/674

@bbasata bbasata merged commit 869dfe7 into main Nov 19, 2024
49 checks passed
@bbasata bbasata deleted the add-build-yml branch November 19, 2024 16:50
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants