Skip to content

Commit f5e1291

Browse files
committed
Fix env vars
Fix CI for docker images (login)
1 parent 998f966 commit f5e1291

File tree

5 files changed

+79
-13
lines changed

5 files changed

+79
-13
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,27 @@ jobs:
1818
with:
1919
go-version: 1.24.2
2020
cache-dependency-path: go.mod
21+
22+
- name: Login to ghcr.io
23+
uses: docker/login-action@v2
24+
with:
25+
registry: ghcr.io
26+
username: ossign
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Login to docker hub
30+
uses: docker/login-action@v2
31+
with:
32+
registry: docker.io
33+
username: ossign
34+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
35+
36+
- name: Install dependencies
37+
run: |
38+
curl https://pkg.ossign.org/debian/repository.key -o /etc/apt/keyrings/gitea-ossign.asc
39+
echo "deb [signed-by=/etc/apt/keyrings/gitea-ossign.asc] https://pkg.ossign.org/debian all main" >> /etc/apt/sources.list.d/ossign.list
40+
apt-get update
41+
apt-get install -y goast
2142
2243
- name: Goreleaser
2344
uses: goreleaser/goreleaser-action@v6
@@ -36,4 +57,3 @@ jobs:
3657
name: release
3758
path: dist/**
3859

39-

.goreleaser.yaml

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@ builds:
66
- CGO_ENABLED=0
77
goos:
88
- linux
9-
- windows
109
- darwin
1110
goarch:
1211
- amd64
1312
- arm64
13+
- id: winbuild
14+
main: ./cmd/
15+
env:
16+
- CGO_ENABLED=0
17+
goos:
18+
- windows
19+
goarch:
20+
- amd64
21+
- arm64
1422

1523

1624
archives:
@@ -53,6 +61,18 @@ nfpms:
5361
- rpm
5462
bindir: /usr/local/bin
5563

64+
binary_signs:
65+
- id: goest
66+
ids:
67+
- winbuild
68+
cmd: goest
69+
args:
70+
- sign
71+
- azurekv
72+
- --config
73+
- ./config.yaml
74+
- ${artifact}
75+
5676
release:
5777
github:
5878
owner: ossign
@@ -65,21 +85,47 @@ dockers:
6585
goarch: amd64
6686
dockerfile: Dockerfile
6787
image_templates:
68-
- ghcr.io/ossign/goest:{{ .Tag }}
88+
- ghcr.io/ossign/goest:{{ .Tag }}-linux-amd64
89+
- ossign/goest:{{ .Tag }}-linux-amd64
6990
- id: goest-linux-arm64
7091
use: docker
7192
goos: linux
7293
goarch: arm64
7394
dockerfile: Dockerfile
7495
image_templates:
75-
- ghcr.io/ossign/goest:{{ .Tag }}-arm64
96+
- ghcr.io/ossign/goest:{{ .Tag }}-linux-arm64
97+
- ossign/goest:{{ .Tag }}-linux-arm64
7698
- id: goest-windows-amd64
7799
use: docker
78100
goos: windows
79101
goarch: amd64
80102
dockerfile: windows.Dockerfile
81103
image_templates:
104+
- ghcr.io/ossign/goest:{{ .Tag }}-windows-amd64
82105
- ghcr.io/ossign/goest:{{ .Tag }}-windows
106+
- ossign/goest:{{ .Tag }}-windows-amd64
107+
- ossign/goest:{{ .Tag }}-windows
108+
109+
docker_manifests:
110+
- name_template: ghcr.io/ossign/goest:latest
111+
image_templates:
112+
- ghcr.io/ossign/goest:{{ .Tag }}-linux-amd64
113+
- ghcr.io/ossign/goest:{{ .Tag }}-linux-arm64
114+
115+
- name_template: ghcr.io/ossign/goest:{{ .Tag }}
116+
image_templates:
117+
- ghcr.io/ossign/goest:{{ .Tag }}-linux-amd64
118+
- ghcr.io/ossign/goest:{{ .Tag }}-linux-arm64
119+
120+
- name_template: ossign/goest:latest
121+
image_templates:
122+
- ossign/goest:{{ .Tag }}-linux-amd64
123+
- ossign/goest:{{ .Tag }}-linux-arm64
124+
125+
- name_template: ossign/goest:{{ .Tag }}
126+
image_templates:
127+
- ossign/goest:{{ .Tag }}-linux-amd64
128+
- ossign/goest:{{ .Tag }}-linux-arm64
83129

84130
uploads:
85131
- name: "debpkg"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ To sign a file with Azure Key Vault, use the following command:
5151
goest sign azurekv --url https://<your-key-vault-name>.vault.azure.net/certificates/your-certificate/certificate-hash/ --tenant <your-tenant-uuid> --client <your-client-id> --secret <your-client-secret> file1.ps1 file2.exe file3.dll
5252

5353
# Using environment variables
54-
export goest_AZUREKV_URL="https://<your-key-vault-name>.vault.azure.net/certificates/your-certificate/certificate-hash/"
55-
export goest_AZUREKV_TENANT="<your-tenant-uuid>"
56-
export goest_AZUREKV_CLIENT="<your-client-id>"
57-
export goest_AZUREKV_SECRET="<your-client-secret>"
54+
export GOEST_AZUREKV_URL="https://<your-key-vault-name>.vault.azure.net/certificates/your-certificate/certificate-hash/"
55+
export GOEST_AZUREKV_TENANT="<your-tenant-uuid>"
56+
export GOEST_AZUREKV_CLIENT="<your-client-id>"
57+
export GOEST_AZUREKV_SECRET="<your-client-secret>"
5858

5959
goest sign azurekv file1.ps1 file2.exe file3.dll
6060

cmd/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var rootCmd = &cobra.Command{
2828

2929
Viper.SetConfigFile(configFile)
3030
Viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
31-
Viper.SetEnvPrefix("goest")
31+
Viper.SetEnvPrefix("GOEST")
3232
Viper.AutomaticEnv()
3333

3434
if err := Viper.ReadInConfig(); err != nil {

lib/vaults/azurekeyvault.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ func (v *AzureKeyVault) GetCommand() *cobra.Command {
3535
}
3636

3737
if v.Url == "" {
38-
fmt.Println("Azure Key Vault URL is required. Use --url, -u or env goest_AZUREKV_URL to specify the URL. Example: --url https://myvault.vault.azure.net/certificates/MyCertificate/1234567890abcdef1234567890abcdef")
38+
fmt.Println("Azure Key Vault URL is required. Use --url, -u or env GOEST_AZUREKV_URL to specify the URL. Example: --url https://myvault.vault.azure.net/certificates/MyCertificate/1234567890abcdef1234567890abcdef")
3939
}
4040

4141
if v.Tenant == "" {
42-
fmt.Println("Azure Tenant ID is required. Use --tenant, -t or env goest_AZUREKV_TENANT to specify the Tenant ID. Example: --tenant 12345678-1234-1234-1234-123456789012")
42+
fmt.Println("Azure Tenant ID is required. Use --tenant, -t or env GOEST_AZUREKV_TENANT to specify the Tenant ID. Example: --tenant 12345678-1234-1234-1234-123456789012")
4343
}
4444
if v.Client == "" {
45-
fmt.Println("Azure Client ID is required. Use --client, -c or env goest_AZUREKV_CLIENT to specify the Client ID. Example: --client 12345678-1234-1234-1234-123456789012")
45+
fmt.Println("Azure Client ID is required. Use --client, -c or env GOEST_AZUREKV_CLIENT to specify the Client ID. Example: --client 12345678-1234-1234-1234-123456789012")
4646
}
4747
if v.Secret == "" {
48-
fmt.Println("Azure Key Vault Secret Name is required. Use --secret, -s or goest_AZUREKV_SECRET to specify the Secret Name. Example: --secret MySecretName")
48+
fmt.Println("Azure Key Vault Secret Name is required. Use --secret, -s or GOEST_AZUREKV_SECRET to specify the Secret Name. Example: --secret MySecretName")
4949
}
5050

5151
if len(args) == 0 {

0 commit comments

Comments
 (0)