-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RE 2997 error building chainlink binary with wasmtime go dependency (#…
…14583) * Refactor .goreleaser.develop.yaml to use multi-platform native compilation * Make required changes to get platform native builds working * Programmatic goreleaser config generator, works with .goreleaser.develop.yaml * Remove broken goreleaser makefile cmds * Remove zig dep from shell.nix * Remove macos-sdk, goreleaser exec, zig refs from goreleaser action * Use no_unique_dist_dir config since we only build 1 target a time * Remove qemu support * Use ubuntu 24 for goreleaser base image * Test split builds w/o merge * Add sensible default for CHAINLINK_VERSION * Set chainlink version in github action * Merge ccip and regular builds together * Use nightlies over snapshots * Split and merge * Correctly set release type * Quote nullable var * Pass down release type * goreleaserpro -> goreleaser * Set nightly version correctly * Add fetch depth * Make name more accurate * Fix merge cmd * Disable changelogs + archives unless prod * Update develop config file * Sign nightly images * Handle prod image name prefix * prod -> production * Remove stale fixtures * Add production config generation * Correctly add ECR path to prod images * Merge production + ccip production together * Disable changelog on develop * Remove env var shadowing and redundant templating * Remove signing for develop builds * Fix nightly version template * Refactor build-sign-publish inputs * Fix skippush condition, remove cosign signing * Nuke cosign from goreleaser action in favor of gh artifact attestation * Apply split+merge refactor to prod pipeline * Run gomodtidy * Remove useless test * Update go.mod * Remove push on release/** trigger * Add fetch-depth 0 to image builds * Use a separate workflow for goreleaser * Update gomods * TEST: goreleaser prod * Add missing env * Fix yaml extension * Add missing fetch depth * Fix incorrect manifest naming * Configure skip_push for prod manifests * Refactor artifact path handling in build-publish-goreleaser.yml * Remove artifact attestation * Update go.mod * Remove test branch trigger
- Loading branch information
1 parent
be774f0
commit 65f1d9d
Showing
22 changed files
with
1,409 additions
and
1,467 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
82 changes: 0 additions & 82 deletions
82
.github/actions/goreleaser-build-sign-publish/action_utils
This file was deleted.
Oops, something went wrong.
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,93 @@ | ||
#!/usr/bin/env node | ||
const { execSync } = require("child_process"); | ||
|
||
function main() { | ||
const goreleaserConfig = mustGetEnv("GORELEASER_CONFIG"); | ||
const releaseType = mustGetEnv("RELEASE_TYPE"); | ||
const command = constructGoreleaserCommand(releaseType, goreleaserConfig); | ||
|
||
if (process.env.DRY_RUN) { | ||
console.log(`Generated command: ${command}`); | ||
console.log("Dry run enabled. Exiting without executing the command."); | ||
return; | ||
} else { | ||
console.log(`Executing command: ${command}`); | ||
execSync(command, { stdio: "inherit" }); | ||
} | ||
} | ||
|
||
main(); | ||
|
||
function constructGoreleaserCommand(releaseType, goreleaserConfig) { | ||
const version = getVersion(); | ||
const flags = []; | ||
|
||
checkReleaseType(releaseType); | ||
|
||
let subCmd = "release"; | ||
const splitArgs = ["--split", "--clean"]; | ||
|
||
switch (releaseType) { | ||
case "release": | ||
flags.push(...splitArgs); | ||
break; | ||
case "nightly": | ||
flags.push("--nightly", ...splitArgs); | ||
break; | ||
case "snapshot": | ||
flags.push("--snapshot", ...splitArgs); | ||
break; | ||
case "merge": | ||
flags.push("--merge"); | ||
subCmd = "continue"; | ||
break; | ||
} | ||
|
||
const flagsStr = flags.join(" "); | ||
if (releaseType === "merge") { | ||
return `CHAINLINK_VERSION=${version} goreleaser ${subCmd} ${flagsStr}`; | ||
} else { | ||
return `CHAINLINK_VERSION=${version} goreleaser ${subCmd} --config ${goreleaserConfig} ${flagsStr}`; | ||
} | ||
} | ||
|
||
function checkReleaseType(releaseType) { | ||
const VALID_RELEASE_TYPES = ["nightly", "merge", "snapshot", "release"]; | ||
|
||
if (!VALID_RELEASE_TYPES.includes(releaseType)) { | ||
const validReleaseTypesStr = VALID_RELEASE_TYPES.join(", "); | ||
console.error( | ||
`Error: Invalid release type: ${releaseType}. Must be one of: ${validReleaseTypesStr}` | ||
); | ||
} | ||
} | ||
|
||
function mustGetEnv(key) { | ||
const val = process.env[key]; | ||
if (!val || val.trim() === "") { | ||
console.error(`Error: Environment variable ${key} is not set or empty.`); | ||
process.exit(1); | ||
} | ||
|
||
return val.trim(); | ||
} | ||
|
||
function getVersion() { | ||
try { | ||
const pkgPath = process.cwd() + "/package.json"; | ||
console.log("Looking for chainlink version in package.json at: ", pkgPath); | ||
const packageJson = require(pkgPath); | ||
if (!packageJson.version) { | ||
console.error( | ||
'Error: "version" field is missing or empty in package.json.' | ||
); | ||
process.exit(1); | ||
} | ||
console.log("Resolved version: ", packageJson.version); | ||
|
||
return packageJson.version; | ||
} catch (err) { | ||
console.error(`Error reading package.json: ${err.message}`); | ||
process.exit(1); | ||
} | ||
} |
Oops, something went wrong.