-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1058 from willswire/main
add go/bump as a default pipeline
- Loading branch information
Showing
3 changed files
with
130 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# SPDX-FileCopyrightText: 2022 Chainguard, Inc | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# This is a sample configuration file to demonstrate how to build a software | ||
# project using melange's built-in go/build pipeline. | ||
# | ||
# For more information about melange's built-in golang support check out: | ||
# https://github.com/chainguard-dev/melange/blob/main/docs/PIPELINES-GO.md | ||
# | ||
# For an equivalent pipeline that uses go/install to build the same project | ||
# please see go-install.yaml in this directory. | ||
package: | ||
name: hello | ||
version: 0.0.1 | ||
epoch: 0 | ||
description: "A project that will greet the world infinitely" | ||
|
||
environment: | ||
contents: | ||
keyring: | ||
- https://packages.wolfi.dev/os/wolfi-signing.rsa.pub | ||
repositories: | ||
- https://packages.wolfi.dev/os | ||
|
||
pipeline: | ||
- uses: git-checkout | ||
with: | ||
repository: https://github.com/puerco/hello.git | ||
expected-commit: a73c4feb284dc6ed1e5758740f717f99dcd4c9d7 | ||
tag: v${{package.version}} | ||
|
||
- uses: go/bump | ||
with: | ||
deps: github.com/sirupsen/logrus@v1.9.3 | ||
|
||
- uses: go/build | ||
with: | ||
tags: enterprise | ||
packages: . | ||
output: hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Bump go deps to a certain version | ||
|
||
needs: | ||
packages: | ||
- git | ||
- gobump | ||
|
||
inputs: | ||
deps: | ||
description: The deps to bump, space separated | ||
required: true | ||
modroot: | ||
description: The root of the module | ||
default: . | ||
go-version: | ||
description: "The go version to set the go.mod syntax to" | ||
default: "" | ||
replaces: | ||
description: "The replaces to add to the go.mod file" | ||
tidy: | ||
default: true | ||
description: Run go mod tidy command before and after the bump | ||
show-diff: | ||
default: false | ||
description: Show the difference between the go.mod file before and after the bump | ||
tidy-compat: | ||
description: "Set the go version for which the tidied go.mod and go.sum files should be compatible" | ||
default: "" | ||
|
||
pipeline: | ||
- runs: | | ||
cd "${{inputs.modroot}}" | ||
# We use the --tidy flag to run go mod tidy before and after in some cases (if old versions of go are used, we need to update the go.mod format) | ||
gobump --packages "${{inputs.deps}}" --replaces "${{inputs.replaces}}" --tidy=${{inputs.tidy}} --show-diff=${{inputs.show-diff}} --go-version=${{inputs.go-version}} --compat=${{inputs.tidy-compat}} |