Skip to content

Commit 6521347

Browse files
authored
Support runner override, zsh autocomplete and build improvements (#6)
2 parents cd7fc0c + 8528f4b commit 6521347

File tree

32 files changed

+709
-197
lines changed

32 files changed

+709
-197
lines changed

.github/dependabot.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"

.github/workflows/release.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ on:
55
tags:
66
- "v*"
77

8-
permissions:
9-
contents: write # create GH releases
10-
id-token: write # ephemeral keys (a.k.a. "keyless") signing
8+
permissions: {}
119

1210
jobs:
1311
goreleaser:
1412
runs-on: ubuntu-latest
1513

14+
permissions:
15+
contents: write # create GH releases
16+
id-token: write # ephemeral keys (a.k.a. "keyless") signing
17+
attestations: write # write GH attestations
18+
1619
steps:
1720
- name: Checkout
1821
uses: actions/checkout@v4
@@ -24,14 +27,19 @@ jobs:
2427
with:
2528
go-version: stable
2629

27-
- uses: anchore/sbom-action/download-syft@v0.15.0
28-
- uses: sigstore/cosign-installer@v3.4.0
30+
- uses: anchore/sbom-action/download-syft@v0.17.7
31+
- uses: sigstore/cosign-installer@v3.7.0
2932

3033
- name: Run GoReleaser
31-
uses: goreleaser/goreleaser-action@v5
34+
uses: goreleaser/goreleaser-action@v6
3235
with:
3336
distribution: goreleaser
34-
version: latest
37+
version: '~> v2'
3538
args: release --clean
3639
env:
3740
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
42+
- name: Attest release artefacts
43+
uses: actions/attest-build-provenance@v1
44+
with:
45+
subject-path: "dist/qubesome*"

.github/workflows/test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ name: tests
33
on:
44
push:
55

6-
permissions:
7-
contents: read
6+
permissions: {}
87

98
jobs:
109
tests:
1110
runs-on: ubuntu-latest
1211

12+
permissions:
13+
contents: read
14+
1315
steps:
1416
- name: Checkout
1517
uses: actions/checkout@v4

.goreleaser.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version: 2
12
project_name: qubesome
23
builds:
34
- id: qubesome

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ go install github.com/qubesome/cli/cmd/qubesome@latest
2424

2525
##### For Tumbleweed users
2626
```
27-
zypper install qubesome
27+
zypper install -y qubesome
2828
```
2929

3030
#### Start Profile
@@ -45,7 +45,7 @@ To transfer clipboards between profiles use `qubesome clipboard`.
4545

4646
Check whether dependency requirements are met:
4747
```
48-
qubesome deps show
48+
qubesome deps
4949
```
5050

5151
Use a local copy, and if not found fallback to a fresh clone:
@@ -129,8 +129,8 @@ Ability to control network/internet access for each workload, and run the window
129129
manager without internet access. Auditing access violations, for visibility of when
130130
workloads are trying to access things they should not.
131131

132-
#### Is Rootless docker support?
133-
Not at this point, potentially this could be introduced in the future.
132+
#### Is rootless supported?
133+
Yes, but only with podman.
134134

135135
### Why do I need to run xhost +SI:localuser:${USER}?
136136
Some Linux distros (e.g. Tumbleweed) have X11 access controls enabled
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#compdef qubesome
2+
compdef _qubesome qubesome
3+
4+
_qubesome() {
5+
local -a opts
6+
local cur
7+
cur=${words[-1]}
8+
if [[ "$cur" == "-"* ]]; then
9+
opts=("${(@f)$(${words[@]:0:#words[@]-1} ${cur} --generate-shell-completion)}")
10+
else
11+
opts=("${(@f)$(${words[@]:0:#words[@]-1} --generate-shell-completion)}")
12+
fi
13+
14+
if [[ "${opts[1]}" != "" ]]; then
15+
_describe 'values' opts
16+
else
17+
_files
18+
fi
19+
}
20+
21+
if [ "$funcstack[1]" = "_qubesome" ]; then
22+
_qubesome
23+
fi

cmd/cli/completion.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package cli
2+
3+
import (
4+
"context"
5+
_ "embed"
6+
"fmt"
7+
8+
"github.com/urfave/cli/v3"
9+
)
10+
11+
//go:embed autocomplete/zsh_autocomplete
12+
var autocompleteZSH string
13+
14+
func completionCommand() *cli.Command {
15+
cmd := &cli.Command{
16+
Name: "autocomplete",
17+
Usage: "Generate autocomplete",
18+
UsageText: "source <(qubesome autocomplete)",
19+
Action: func(ctx context.Context, cmd *cli.Command) error {
20+
fmt.Println(autocompleteZSH)
21+
return nil
22+
},
23+
}
24+
return cmd
25+
}

cmd/cli/images.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,18 @@ func imagesCommand() *cli.Command {
2020
Name: "profile",
2121
Destination: &targetProfile,
2222
},
23+
&cli.StringFlag{
24+
Name: "runner",
25+
Destination: &runner,
26+
},
2327
},
2428
Action: func(ctx context.Context, cmd *cli.Command) error {
2529
cfg := profileConfigOrDefault(targetProfile)
2630

27-
return images.Run(images.WithConfig(cfg))
31+
return images.Run(
32+
images.WithConfig(cfg),
33+
images.WithRunner(runner),
34+
)
2835
},
2936
},
3037
},

cmd/cli/root.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ var (
1818
workload string
1919
path string
2020
local string
21+
runner string
2122
debug bool
2223
)
2324

@@ -31,6 +32,7 @@ func RootCommand() *cli.Command {
3132
xdgCommand(),
3233
depsCommand(),
3334
versionCommand(),
35+
completionCommand(),
3436
},
3537
}
3638

cmd/cli/run.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ func runCommand() *cli.Command {
2424
Name: "profile",
2525
Destination: &targetProfile,
2626
},
27+
&cli.StringFlag{
28+
Name: "runner",
29+
Destination: &runner,
30+
},
2731
},
2832
Usage: "execute workloads",
2933
Action: func(ctx context.Context, cmd *cli.Command) error {
@@ -33,6 +37,7 @@ func runCommand() *cli.Command {
3337
qubesome.WithWorkload(workload),
3438
qubesome.WithProfile(targetProfile),
3539
qubesome.WithConfig(cfg),
40+
qubesome.WithRunner(runner),
3641
qubesome.WithExtraArgs(cmd.Args().Slice()),
3742
)
3843
},

0 commit comments

Comments
 (0)