Skip to content

Commit 153c08e

Browse files
authored
Publish linux packages (#3)
1 parent 2358305 commit 153c08e

3 files changed

Lines changed: 31 additions & 22 deletions

File tree

.github/workflows/goreleaser.yaml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@ on:
88

99
permissions:
1010
contents: write
11+
id-token: write
1112

1213
jobs:
1314
goreleaser:
14-
runs-on: ubuntu-24.04
15-
steps:
16-
- name: Checkout
17-
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
18-
with:
19-
fetch-depth: 0
20-
21-
- name: Set up Go
22-
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
23-
with:
24-
go-version: '>=1.25.3'
25-
26-
- name: Run GoReleaser
27-
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6
28-
with:
29-
distribution: goreleaser
30-
version: latest
31-
args: release --clean
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.HOMEBREW_REPO }}
15+
uses: libops/terraform-linux-packages/.github/workflows/reusable-goreleaser.yaml@main
16+
permissions:
17+
contents: write
18+
id-token: write
19+
secrets: inherit
20+
with:
21+
go-version: ">=1.25.3"
22+
publish-package-repo: true
23+
package-name: sitectl-drupal
24+
package-repo-prefix: sitectl
25+
package-repo-label: sitectl
26+
package-public-key-name: sitectl-archive-keyring
27+
gcp-project: ${{ vars.LIBOPS_PACKAGES_GCLOUD_PROJECT }}
28+
workload-identity-provider: ${{ vars.LIBOPS_PACKAGES_GCLOUD_OIDC_POOL }}
29+
service-account: ${{ vars.LIBOPS_PACKAGES_GSA }}
30+
gcs-bucket: ${{ vars.LIBOPS_PACKAGES_GCS_BUCKET }}
31+
aptly-gpg-key-id: ${{ vars.LIBOPS_PACKAGES_APTLY_GPG_KEY_ID }}
32+
aptly-gpg-private-key-secret: ${{ vars.LIBOPS_PACKAGES_APTLY_GPG_PRIVATE_KEY_SECRET }}
33+
aptly-gpg-passphrase-secret: ${{ vars.LIBOPS_PACKAGES_APTLY_GPG_PASSPHRASE_SECRET }}

.goreleaser.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ builds:
66
- binary: sitectl-drupal
77
env:
88
- CGO_ENABLED=0
9+
ldflags:
10+
- -s -w -X main.version={{ .Version }} -X main.commit={{ .Commit }} -X main.date={{ .Date }}
911
goos:
1012
- linux
1113
- windows
@@ -65,4 +67,3 @@ nfpms:
6567
- sitectl-drupal
6668
dependencies:
6769
- sitectl
68-

main.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
package main
22

33
import (
4+
"fmt"
5+
46
"github.com/libops/sitectl-drupal/cmd"
57
"github.com/libops/sitectl/pkg/plugin"
68
)
79

10+
var (
11+
version = "dev"
12+
commit = "none"
13+
date = "unknown"
14+
)
15+
816
func main() {
917
sdk := plugin.NewSDK(plugin.Metadata{
1018
Name: "drupal",
11-
Version: "v0.0.3",
19+
Version: fmt.Sprintf("%s (Built on %s from Git SHA %s)", version, date, commit),
1220
Description: "Drupal utilities and migration tools",
1321
Author: "libops",
1422
})

0 commit comments

Comments
 (0)