Skip to content

Commit 126be70

Browse files
committed
feat: update pipeline
1 parent de031fc commit 126be70

4 files changed

Lines changed: 21 additions & 24 deletions

File tree

.github/workflows/release.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout
17-
uses: actions/Checkout@v3
17+
uses: actions/Checkout@v4
1818
- name: Dagger Go Flow
1919
uses: dagger/dagger-for-github@v7
2020
env:
@@ -24,4 +24,6 @@ jobs:
2424
verb: call
2525
module: dagger
2626
args: test-and-release --source=. --token=env://GITHUB_TOKEN
27+
cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }}
28+
2729

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ extend or merge structs which have struct fields of type `any` their value must
3939
## Install
4040

4141
```sh
42-
go get github.com/MartinSimango/dstruct@v0.5.0-beta
42+
go get github.com/MartinSimango/dstruct@v0.6.0
4343
```
4444

4545
## How it works?

dagger.json

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@
44
"sdk": {
55
"source": "go"
66
},
7-
"dependencies": [
8-
{
9-
"name": "go-dagger",
10-
"source": "github.com/felipecruz91/daggerverse/go",
11-
"pin": "812413ffa7ed126d04dee7be21e9cda1a815e618"
12-
},
13-
{
14-
"name": "node",
15-
"source": "github.com/dagger/dagger/sdk/typescript/dev/node",
16-
"pin": "180573cf2a1359a7ce371f92a6b6d5fdde62c5a4"
17-
}
18-
],
7+
198
"source": "dagger"
209
}

dagger/main.go

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,31 @@ func (m *Dagger) Release(
2828
source *dagger.Directory,
2929
token *dagger.Secret,
3030
) (string, error) {
31-
return dag.Node(dagger.NodeOpts{
32-
Version: "23.7.0",
33-
}).
34-
WithNpm().
35-
WithSource(source).
36-
Container().
31+
return dag.Container().
32+
From("node:23.7.0").
33+
WithDirectory("/src", source).
34+
WithWorkdir("/src").
35+
WithMountedCache("/root/.npm", dag.CacheVolume("node-23")).
3736
WithSecretVariable("GITHUB_TOKEN", token).
3837
WithExec([]string{"npm", "install", "--save-dev", "@semantic-release/git"}).
3938
WithExec([]string{"npm", "install", "--save-dev", "@semantic-release/changelog"}).
4039
WithExec([]string{"npm", "install", "--save-dev", "conventional-changelog-conventionalcommits"}).
41-
WithExec([]string{"npx", "semantic-release", "--no-ci"}).
40+
WithExec([]string{"npx", "semantic-release", "--dry--run"}).
4241
Stdout(ctx)
4342
}
4443

4544
// Test the project
4645
func (m *Dagger) Test(ctx context.Context, source *dagger.Directory) (string, error) {
47-
return dag.GoDagger().Test(source, dagger.GoDaggerTestOpts{
48-
GoVersion: "1.23",
49-
}).Stdout(ctx)
46+
return dag.Container().
47+
From("golang:1.24").
48+
WithDirectory("/src", source).
49+
WithWorkdir("/src").
50+
WithMountedCache("/go/pkg/mod", dag.CacheVolume("go-mod-124")).
51+
WithEnvVariable("GOMODCACHE", "/go/pkg/mod").
52+
WithMountedCache("/go/build-cache", dag.CacheVolume("go-build-124")).
53+
WithEnvVariable("GOCACHE", "/go/build-cache").
54+
WithExec([]string{"go", "test", "./..."}).
55+
Stdout(ctx)
5056
}
5157

5258
// Test and release the project

0 commit comments

Comments
 (0)