Skip to content

Commit 1724f51

Browse files
committed
snapshot
1 parent 18673f9 commit 1724f51

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

.github/workflows/build.yml renamed to .github/workflows/build-app.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build binaries
1+
name: Build app
22

33
on:
44
push:

.github/workflows/build-toolbox.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ jobs:
4646
run: |
4747
set -euo pipefail
4848
cd toolbox
49-
./toolbox-builder -playbook ../playbook/60-second-linux.yaml -out toolbox-${{ matrix.arch_tag }}.tar.xz
49+
./toolbox-builder -playbook ../playbook/60-second-linux.yaml -out .
5050
5151
- name: Upload artifact
5252
uses: actions/upload-artifact@v4
5353
with:
5454
name: toolbox-${{ matrix.arch_tag }}
55-
path: toolbox/toolbox-${{ matrix.arch_tag }}.tar.xz
55+
path: toolbox/*.tar.xz
5656
if-no-files-found: error
5757
retention-days: 7
5858

toolbox/generate.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ import (
1818

1919
func main() {
2020
var playbookPath string
21-
var outPath string
21+
var outDir string
2222

2323
flag.StringVar(&playbookPath, "playbook", "", "Path to playbook file")
24-
flag.StringVar(&outPath, "out", "toolbox.tar.xz", "Output archive path")
24+
flag.StringVar(&outDir, "out", ".", "Output directory")
2525
flag.Parse()
2626

2727
if playbookPath == "" {
@@ -64,7 +64,12 @@ func main() {
6464
fatalf("failed to copy playbook file: %v", err)
6565
}
6666

67-
outPath, _ = filepath.Abs(outPath)
67+
outDir, _ = filepath.Abs(outDir)
68+
if err := os.MkdirAll(outDir, 0o755); err != nil {
69+
fatalf("failed to ensure output directory: %v", err)
70+
}
71+
archiveName := fmt.Sprintf("%s.%s.%s.tar.xz", cfg.ID, runtime.GOOS, runtime.GOARCH)
72+
outPath := filepath.Join(outDir, archiveName)
6873
if err := createTarXz(outPath, toolboxDir); err != nil {
6974
fatalf("failed to create tar.xz: %v", err)
7075
}

0 commit comments

Comments
 (0)