Skip to content

Commit d59f5f5

Browse files
Merge pull request #7 from phuongdnguyen/publish-workflow
Add publish workflows
2 parents 7df7483 + 93c960e commit d59f5f5

File tree

30 files changed

+312
-49
lines changed

30 files changed

+312
-49
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Build and Release Tdlv
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
branches:
8+
- main
9+
workflow_dispatch:
10+
inputs:
11+
version:
12+
description: 'Version to release (e.g., 1.0.0)'
13+
required: true
14+
type: string
15+
create_release:
16+
description: 'Create GitHub release'
17+
required: false
18+
type: boolean
19+
default: true
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
25+
strategy:
26+
matrix:
27+
goos: [linux, darwin, windows]
28+
goarch: [amd64, arm64]
29+
exclude:
30+
# Exclude windows/arm64 as it's not commonly supported
31+
- goos: windows
32+
goarch: arm64
33+
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v4
37+
38+
- name: Set up Go
39+
uses: actions/setup-go@v4
40+
with:
41+
go-version: '1.23'
42+
cache: true
43+
44+
- name: Build tdlv
45+
run: |
46+
cd tdlv
47+
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o tdlv-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.exe' || '' }} .
48+
49+
- name: Upload build artifact
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: tdlv-${{ matrix.goos }}-${{ matrix.goarch }}
53+
path: tdlv/tdlv-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.exe' || '' }}
54+
55+
release:
56+
needs: build
57+
runs-on: ubuntu-latest
58+
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.create_release == 'true')
59+
60+
steps:
61+
- name: Checkout code
62+
uses: actions/checkout@v4
63+
64+
- name: Download all artifacts
65+
uses: actions/download-artifact@v4
66+
with:
67+
path: artifacts
68+
69+
- name: Create release
70+
uses: softprops/action-gh-release@v1
71+
with:
72+
files: |
73+
artifacts/tdlv-linux-amd64/tdlv-linux-amd64
74+
artifacts/tdlv-linux-arm64/tdlv-linux-arm64
75+
artifacts/tdlv-darwin-amd64/tdlv-darwin-amd64
76+
artifacts/tdlv-darwin-arm64/tdlv-darwin-arm64
77+
artifacts/tdlv-windows-amd64/tdlv-windows-amd64.exe
78+
draft: false
79+
prerelease: false
80+
generate_release_notes: true
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Publish Go Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
branches:
8+
- main
9+
workflow_dispatch:
10+
inputs:
11+
version:
12+
description: 'Package version to publish (e.g., 1.0.0)'
13+
required: true
14+
type: string
15+
16+
jobs:
17+
publish:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Go
25+
uses: actions/setup-go@v4
26+
with:
27+
go-version: '1.23'
28+
29+
- name: Cache Go modules
30+
uses: actions/cache@v3
31+
with:
32+
path: |
33+
~/go/pkg/mod
34+
~/go/pkg/cache
35+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
36+
restore-keys: |
37+
${{ runner.os }}-go-
38+
39+
- name: Test Go package
40+
run: |
41+
cd replayer-adapter-go
42+
go mod download
43+
go test ./... -v
44+
continue-on-error: true
45+
46+
- name: Build Go package
47+
run: |
48+
cd replayer-adapter-go
49+
go build -v ./...
50+
51+
- name: Create GitHub Release
52+
if: startsWith(github.ref, 'refs/tags/v')
53+
uses: actions/create-release@v1
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
with:
57+
tag_name: ${{ github.ref }}
58+
release_name: Release ${{ github.ref }}
59+
body: |
60+
## Changes in this release
61+
62+
This release includes updates to the Temporal Workflow Debugger Go replayer adapter.
63+
64+
### Package: temporal-replayer-adapter-go
65+
66+
- Version: ${{ github.ref_name }}
67+
- Built from commit: ${{ github.sha }}
68+
- Go version: 1.23
69+
70+
### Installation
71+
72+
```bash
73+
go get github.com/phuongdnguyen/temporal-workflow-debugger/replayer-adapter-go@${{ github.ref_name }}
74+
```
75+
draft: false
76+
prerelease: false
77+
78+
- name: Manual release creation
79+
if: github.event_name == 'workflow_dispatch'
80+
run: |
81+
echo "Manual release triggered for version: ${{ github.event.inputs.version }}"
82+
echo "To create a release, push a tag with the version:"
83+
echo "git tag v${{ github.event.inputs.version }}"
84+
echo "git push origin v${{ github.event.inputs.version }}"
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Publish NPM Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
branches:
8+
- main
9+
- publish-workflow
10+
workflow_dispatch:
11+
inputs:
12+
version:
13+
description: 'Package version to publish (e.g., 1.0.0)'
14+
required: true
15+
type: string
16+
17+
jobs:
18+
publish:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: '18'
29+
cache: 'npm'
30+
cache-dependency-path: replayer-adapter-nodejs/package-lock.json
31+
32+
- name: Install dependencies
33+
run: |
34+
cd replayer-adapter-nodejs
35+
npm ci
36+
37+
- name: Build package
38+
run: |
39+
cd replayer-adapter-nodejs
40+
npm run build
41+
42+
- name: Run tests (if available)
43+
run: |
44+
cd replayer-adapter-nodejs
45+
npm test
46+
continue-on-error: true
47+
48+
# - name: Publish to NPM
49+
# if: startsWith(github.ref, 'refs/tags/v')
50+
# run: |
51+
# cd replayer-adapter-nodejs
52+
# npm publish --access public
53+
# env:
54+
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
55+
56+
- name: Private publish to NPM
57+
if: startsWith(github.ref, 'refs/tags/v')
58+
run: |
59+
cd replayer-adapter-nodejs
60+
npm publish --access public
61+
env:
62+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
63+
64+
- name: Manual publish to NPM
65+
if: github.event_name == 'workflow_dispatch'
66+
run: |
67+
cd replayer-adapter-nodejs
68+
# Update version in package.json if provided
69+
if [ -n "${{ github.event.inputs.version }}" ]; then
70+
npm version ${{ github.event.inputs.version }} --no-git-tag-version
71+
fi
72+
npm publish --access public
73+
env:
74+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
75+
76+
- name: Create GitHub Release
77+
if: startsWith(github.ref, 'refs/tags/v')
78+
uses: actions/create-release@v1
79+
env:
80+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
with:
82+
tag_name: ${{ github.ref }}
83+
release_name: Release ${{ github.ref }}
84+
body: |
85+
## Changes in this release
86+
87+
This release includes updates to the Temporal Workflow Debugger Node.js replayer adapter.
88+
89+
### Package: @phuongdnguyen/replayer-adapter-nodejs
90+
91+
- Version: ${{ github.ref_name }}
92+
- Built from commit: ${{ github.sha }}
93+
draft: false
94+
prerelease: false

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
go-simple:
2-
cd custom-debugger && go clean && go build -o ../tdlv.build && cd ../example/go/simple-workflow && ../../../tdlv.build --lang=go
2+
cd tdlv && go clean && go build -o ../tdlv.build && cd ../example/go/simple-workflow && ../../../tdlv.build --lang=go
33

44
go-structured-ide-integrated:
5-
cd custom-debugger && go clean && go build -o ../tdlv.build && cd ../example/go/structured-workflow/replay-debug-ide-integrated && ../../../../tdlv.build --lang=go
5+
cd tdlv && go clean && go build -o ../tdlv.build && cd ../example/go/structured-workflow/replay-debug-ide-integrated && ../../../../tdlv.build --lang=go
66

77
go-structured-standalone:
8-
cd custom-debugger && go clean && go build -o ../tdlv.build && cd ../example/go/structured-workflow/replay-debug-standalone && ../../../../tdlv.build --lang=go
8+
cd tdlv && go clean && go build -o ../tdlv.build && cd ../example/go/structured-workflow/replay-debug-standalone && ../../../../tdlv.build --lang=go
99

1010
python:
11-
cd custom-debugger && go clean && go build -o ../tdlv.build && cd .. && ./tdlv.build --lang=python
11+
cd tdlv && go clean && go build -o ../tdlv.build && cd .. && ./tdlv.build --lang=python
1212

1313
# Node.js/TypeScript replayer
1414
js:
15-
cd custom-debugger && go clean && go build -o ../tdlv.build && cd ../example/js && ../../tdlv.build --lang=js
15+
cd tdlv && go clean && go build -o ../tdlv.build && cd ../example/js && ../../tdlv.build --lang=js
1616

1717
build:
18-
cd custom-debugger && go clean && go build -o ../tdlv.build
18+
cd tdlv && go clean && go build -o ../tdlv.build
1919

2020
run-ide:
2121
cd jetbrains-plugin && ./gradlew runIde

docs/developer-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
## Setup
44

55
- Clone repository.
6-
- Build custom-debugger: `go build` in custom-debugger/.
6+
- Build tdlv: `go build` in tdlv/.
77
- Build Jetbrainsplugin: see [jetbrains plugin readme](../jetbrains-plugin/README.md)
88
- Build vscode extension: see [vscode extension readme](../vscode-debugger-extension/README.md)
99
## Structure
1010

11-
- custom-debugger/: Intercept message from language debugger.
11+
- tdlv/: Intercept message from language debugger.
1212
- jetbrains-plugin/: Jetbrains Plugin (support Go).
1313
- vscode-debugger-extension: Vscode Extension (support Go, Python, Js/TS).
1414
- replayer-adapter-go/: Inject sentinel breakpoints for Temporal Go SDK.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"temporal.replayerEntrypoint": "vscode-replay.py",
33
"temporal.debugLanguage": "python",
4-
"temporal.debugger.backgroundProcess.command": "tdlv",
5-
"temporal.debugger.backgroundProcess.args": ["--lang=python"]
4+
"temporal.debugger.backgroundProcess.command": "../../tdlv.build",
5+
"temporal.debugger.backgroundProcess.args": ["--lang=python", "--entrypoint=vscode-replay.py"]
66
}

example/python/vscode-replay.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
sys.path.insert(0, project_root)
2020
sys.path.insert(0, replayer_adapter_path)
2121

22-
from replayer import (
22+
from replayer_adapter_python.replayer import (
2323
ReplayMode, ReplayOptions, set_replay_mode,
2424
set_breakpoints, replay
2525
)

jetbrains-plugin/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This plugin provides debugging support for Temporal workflows using the custom `
1111

1212
## Quick Start
1313

14-
1. **Open Your Project**: Open a project containing a wf-debugger setup (with `Makefile`, `custom-debugger/`, and `my-wf/` directories)
14+
1. **Open Your Project**: Open a project containing a wf-debugger setup (with `Makefile`, `tdlv/`, and `my-wf/` directories)
1515

1616
2. **Create Debug Configuration**:
1717
- Right-click on any file in your wf-debugger project
@@ -33,7 +33,7 @@ This plugin provides debugging support for Temporal workflows using the custom `
3333

3434
### Working Directory
3535
- **Required**: Path to your wf-debugger project root
36-
- **Auto-detection**: The plugin automatically finds the project root containing `Makefile`, `custom-debugger/`, and `my-wf/`
36+
- **Auto-detection**: The plugin automatically finds the project root containing `Makefile`, `tdlv/`, and `my-wf/`
3737

3838
### Additional Arguments
3939
- **Default**: `-p 60000` (sets proxy port)
@@ -48,7 +48,7 @@ Your wf-debugger project should contain:
4848
```
4949
wf-debugger/
5050
├── Makefile # Build configuration
51-
├── custom-debugger/ # Custom delve wrapper source
51+
├── tdlv/ # Custom delve wrapper source
5252
├── my-wf/ # Your workflow code
5353
└── build # Generated binary (created automatically)
5454
```
@@ -66,11 +66,11 @@ When you start debugging, the plugin:
6666

6767
### "Could not find wf-debugger project root"
6868
- Ensure your working directory is within a valid wf-debugger project
69-
- Check that `Makefile`, `custom-debugger/`, and `my-wf/` directories exist
69+
- Check that `Makefile`, `tdlv/`, and `my-wf/` directories exist
7070

7171
### "Failed to build tdlv binary"
7272
- Ensure you have Go installed and configured
73-
- Check that the `custom-debugger/` directory contains valid Go source code
73+
- Check that the `tdlv/` directory contains valid Go source code
7474
- Verify that `make` is available in your PATH
7575

7676
### "Go remote debug configuration not available"

jetbrains-plugin/src/main/java/com/temporal/wfdebugger/debug/WfDebugConfigurationProducer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private boolean isWfDebuggerProject(File dir) {
110110

111111
// Check for characteristic files/directories of a wf-debugger project
112112
boolean hasMakefile = new File(dir, "Makefile").exists();
113-
boolean hasDelveWrapper = new File(dir, "custom-debugger").isDirectory();
113+
boolean hasDelveWrapper = new File(dir, "tdlv").isDirectory();
114114
boolean hasMyWf = new File(dir, "my-wf").isDirectory();
115115

116116
return hasMakefile && hasDelveWrapper && hasMyWf;

jetbrains-plugin/src/main/java/com/temporal/wfdebugger/debug/WfDebugRunConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private void initializeDefaults(@NotNull Project project) {
6666

6767
private boolean isWfDebuggerProject(File dir) {
6868
return new File(dir, "Makefile").exists() &&
69-
new File(dir, "custom-debugger").exists() &&
69+
new File(dir, "tdlv").exists() &&
7070
new File(dir, "my-wf").exists();
7171
}
7272

@@ -89,7 +89,7 @@ public void checkConfiguration() throws RuntimeConfigurationException {
8989
// Check if we can find the wf-debugger project structure
9090
if (!findWfDebuggerRoot(workingDir)) {
9191
throw new RuntimeConfigurationWarning(
92-
"Could not find wf-debugger project structure (Makefile, custom-debugger, my-wf) " +
92+
"Could not find wf-debugger project structure (Makefile, tdlv, my-wf) " +
9393
"in or above the working directory. Make sure the working directory is within a wf-debugger project.");
9494
}
9595
}

0 commit comments

Comments
 (0)