Skip to content

Commit 6ab15e2

Browse files
authored
refactor: simplifies tagging (#82)
1 parent 64d5f7e commit 6ab15e2

File tree

37 files changed

+389
-793
lines changed

37 files changed

+389
-793
lines changed

actions/install/dist/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33070,7 +33070,8 @@ const core = __nccwpck_require__(2186);
3307033070
const github = __nccwpck_require__(5438);
3307133071
const tc = __nccwpck_require__(7784);
3307233072

33073-
const projectName = "cli";
33073+
const assetPrefix = "forge-cli";
33074+
const releaseName = "forge-cli";
3307433075
const repoOwner = "input-output-hk";
3307533076
const repoName = "catalyst-forge";
3307633077

@@ -33139,7 +33140,7 @@ function getAssetName() {
3313933140
throw new Error(`Unsupported platform: ${platform}`);
3314033141
}
3314133142

33142-
return `${projectName}-${platformSuffix}.tar.gz`;
33143+
return `${assetPrefix}-${platformSuffix}.tar.gz`;
3314333144
}
3314433145

3314533146
/**
@@ -33187,7 +33188,7 @@ async function getVersionedAsset(octokit, version) {
3318733188
const releases = await getReleases(octokit);
3318833189

3318933190
const targetRelease = releases.find(
33190-
(r) => r.tag_name === `${projectName}/v${version}`,
33191+
(r) => r.tag_name === `${releaseName}/v${version}`,
3319133192
);
3319233193
if (!targetRelease) {
3319333194
throw new Error(`Version ${version} not found`);

actions/install/dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

actions/install/src/main.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ const core = require("@actions/core");
22
const github = require("@actions/github");
33
const tc = require("@actions/tool-cache");
44

5-
const projectName = "cli";
5+
const assetPrefix = "forge-cli";
6+
const releaseName = "forge-cli";
67
const repoOwner = "input-output-hk";
78
const repoName = "catalyst-forge";
89

@@ -71,7 +72,7 @@ function getAssetName() {
7172
throw new Error(`Unsupported platform: ${platform}`);
7273
}
7374

74-
return `${projectName}-${platformSuffix}.tar.gz`;
75+
return `${assetPrefix}-${platformSuffix}.tar.gz`;
7576
}
7677

7778
/**
@@ -119,7 +120,7 @@ async function getVersionedAsset(octokit, version) {
119120
const releases = await getReleases(octokit);
120121

121122
const targetRelease = releases.find(
122-
(r) => r.tag_name === `${projectName}/v${version}`,
123+
(r) => r.tag_name === `${releaseName}/v${version}`,
123124
);
124125
if (!targetRelease) {
125126
throw new Error(`Version ${version} not found`);

blueprint.cue

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ global: {
66
"^build(-.*)?$",
77
"^package(-.*)?$",
88
"^test(-.*)?$",
9-
"^release(-.*)?$",
10-
"^publish(-.*)?$",
119
]
1210
registries: [
1311
ci.providers.aws.registry,
@@ -49,12 +47,6 @@ global: {
4947
path: "GITHUB_TOKEN"
5048
},
5149
]
52-
tagging: {
53-
aliases: {
54-
forge: "cli"
55-
}
56-
strategy: "commit"
57-
}
5850
}
5951
deployment: {
6052
registry: ci.providers.aws.registry

cli/Earthfile

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,25 +67,3 @@ github:
6767
--version=$version) bin/forge
6868

6969
SAVE ARTIFACT bin/forge forge
70-
71-
docker:
72-
FROM debian:bookworm-slim
73-
WORKDIR /workspace
74-
75-
ARG container="forge"
76-
ARG tag="latest"
77-
ARG version="dev"
78-
79-
ARG TARGETOS
80-
ARG TARGETARCH
81-
ARG USERPLATFORM
82-
83-
COPY \
84-
--platform=$USERPLATFORM \
85-
(+build/forge \
86-
--GOOS=$TARGETOS \
87-
--GOARCH=$TARGETARCH \
88-
--version=$version) /usr/local/bin/forge
89-
90-
ENTRYPOINT ["/usr/local/bin/forge"]
91-
SAVE IMAGE ${container}:${tag}

cli/blueprint.cue

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
version: "1.0"
22
project: {
3-
name: "forge"
3+
name: "forge-cli"
44
ci: targets: {
5-
docker: {
6-
args: {
7-
version: string | *"dev" @forge(name="GIT_TAG")
8-
}
9-
platforms: [
10-
"linux/amd64",
11-
"linux/arm64",
12-
]
13-
}
145
github: {
156
args: {
167
version: string | *"dev" @forge(name="GIT_TAG")
@@ -25,16 +16,11 @@ project: {
2516
test: retries: 3
2617
}
2718
release: {
28-
docker: {
29-
on: {
30-
merge: {}
31-
tag: {}
32-
}
33-
config: {}
34-
}
3519
github: {
3620
on: tag: {}
3721
config: {
22+
name: string | *"dev" @forge(name="GIT_TAG")
23+
prefix: project.name
3824
token: {
3925
provider: "env"
4026
path: "GITHUB_TOKEN"

cli/cmd/cmds/tag.go

Lines changed: 0 additions & 53 deletions
This file was deleted.

cli/cmd/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ var cli struct {
3131
Run cmds.RunCmd `kong:"cmd" help:"Run an Earthly target."`
3232
Scan cmds.ScanCmd `kong:"cmd" help:"Scan for Earthfiles."`
3333
Secret cmds.SecretCmd `kong:"cmd" help:"Manage secrets."`
34-
Tag cmds.TagCmd `kong:"cmd" help:"Generate a tag for a project."`
3534
Validate cmds.ValidateCmd `kong:"cmd" help:"Validates a project."`
3635
Version VersionCmd `kong:"cmd" help:"Print the version."`
3736

cli/cmd/testdata/run/1.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ test
1010
Image ./dir1+test output as test
1111
-- earthly_stdout.txt --
1212
Image ./dir1+test output as test
13+
-- dir1/blueprint.cue --
14+
version: "1.0.0"
15+
project: name: "dir1"
1316
-- dir1/Earthfile --
1417
VERSION 0.8
1518

cli/cmd/testdata/run/2.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Artifact ./dir1+test output as test
1414
-- earthly_stdout.txt --
1515
Image ./dir1+test output as test
1616
Artifact ./dir1+test output as test
17+
-- dir1/blueprint.cue --
18+
version: "1.0.0"
19+
project: name: "dir1"
1720
-- dir1/Earthfile --
1821
VERSION 0.8
1922

0 commit comments

Comments
 (0)