Skip to content

Modern Docker Management, Designed for Everyone

12.7 KB
Raw Blame
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
# vim: set ts=2 sw=2 tw=0 fo=jcroql
version: 2
pro: true

project_name: arcane

metadata:
  maintainers:
    - 'Kyle Mendell <[email protected]>'
  license: 'BSD-3-Clause'
  homepage: 'https://getarcane.app/'
  description: 'Modern Docker Management, Designed for Everyone.'

git:
  ignore_tag_prefixes:
    - backend/
    - cli/
    - types/

before:
  hooks:
    - just build single frontend

builds:
  - id: arcane
    main: ./cmd/main.go
    dir: backend
    binary: arcane
    env:
      - CGO_ENABLED=0
    goos:
      - linux
      - darwin
    goarch:
      - amd64
      - arm64
      - '386'
      - arm
      - riscv64
    goarm:
      - '7'
    goamd64:
      - v1
    go386:
      - sse2
    goriscv64:
      - rva20u64
    ignore:
      - goos: darwin
        goarch: riscv64
    ldflags:
      - -w -s
      - -buildid={{ .Version }}
      - -X github.com/getarcaneapp/arcane/backend/v2/internal/config.Version={{ .Version }}
      - -X github.com/getarcaneapp/arcane/backend/v2/internal/config.Revision={{ .FullCommit }}
      - -X github.com/getarcaneapp/arcane/backend/v2/internal/config.BuildTime={{ .Date }}
      - -X github.com/getarcaneapp/arcane/backend/v2/internal/config.NodeVersion={{ envOrDefault "NODE_VERSION" "unknown" }}
      - -X github.com/getarcaneapp/arcane/backend/v2/internal/config.SvelteKitVersion={{ envOrDefault "SVELTEKIT_VERSION" "unknown" }}
    flags:
      - -trimpath
    mod_timestamp: '{{ .CommitTimestamp }}'

  - id: arcane-agent
    main: ./cmd/main.go
    dir: backend
    binary: arcane-agent
    tags:
      - exclude_frontend
    env:
      - CGO_ENABLED=0
    goos:
      - linux
      - darwin
    goarch:
      - amd64
      - arm64
      - '386'
      - arm
      - riscv64
    goarm:
      - '7'
    goamd64:
      - v1
    go386:
      - sse2
    goriscv64:
      - rva20u64
    ignore:
      - goos: darwin
        goarch: riscv64
    ldflags:
      - -w -s
      - -buildid={{ .Version }}
      - -X github.com/getarcaneapp/arcane/backend/v2/internal/config.Version={{ .Version }}
      - -X github.com/getarcaneapp/arcane/backend/v2/internal/config.Revision={{ .FullCommit }}
      - -X github.com/getarcaneapp/arcane/backend/v2/internal/config.BuildTime={{ .Date }}
    flags:
      - -trimpath
    mod_timestamp: '{{ .CommitTimestamp }}'

  - id: arcane-cli
    main: .
    dir: cli
    binary: arcane-cli
    env:
      - CGO_ENABLED=0
    goos:
      - linux
      - darwin
    goarch:
      - amd64
      - arm64
      - '386'
      - arm
      - riscv64
    goarm:
      - '7'
    goamd64:
      - v1
    go386:
      - sse2
    goriscv64:
      - rva20u64
    ignore:
      - goos: darwin
        goarch: amd64
      - goos: darwin
        goarch: riscv64
    ldflags:
      - -w -s
      - -buildid={{ .Version }}
      - -X github.com/getarcaneapp/arcane/cli/v2/internal/config.Version={{ .Version }}
      - -X github.com/getarcaneapp/arcane/cli/v2/internal/config.Revision={{ .FullCommit }}
    flags:
      - -trimpath
    mod_timestamp: '{{ .CommitTimestamp }}'

archives:
  - id: arcane-cli-archive
    ids:
      - arcane-cli
    formats:
      - tar.gz
    name_template: &binary-name '{{ .Binary }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}'
  - id: arcane-cli-binary
    ids:
      - arcane-cli
    formats:
      - binary
    name_template: *binary-name
  - id: default
    ids:
      - arcane
      - arcane-agent
    formats:
      - binary
    name_template: *binary-name

notarize:
  macos:
    - enabled: '{{ not .IsSnapshot }}'
      ids:
        - arcane-cli
      sign:
        certificate: '{{ .Env.MACOS_SIGN_P12 }}'
        password: '{{ .Env.MACOS_SIGN_PASSWORD }}'
      notarize:
        issuer_id: '{{ .Env.MACOS_NOTARY_ISSUER_ID }}'
        key_id: '{{ .Env.MACOS_NOTARY_KEY_ID }}'
        key: '{{ .Env.MACOS_NOTARY_KEY }}'
        wait: true
        timeout: 20m

signs:
  - id: cosign-checksums
    cmd: cosign
    artifacts: checksum
    signature: '${artifact}.sigstore.json'
    args:
      - sign-blob
      - --key=env://COSIGN_PRIVATE_KEY
      - --bundle=${signature}
      - '${artifact}'
      - --yes
    output: true

nightly:
  version_template: '{{ .Env.NEXT_IMAGE_VERSION }}'

nfpms:
  - id: arcane-cli
    package_name: '{{ if eq (index .Env "BUILD_NEXT") "true" }}arcane-cli-next{{ else }}arcane-cli{{ end }}'
    file_name_template: '{{ .ConventionalFileName }}'
    ids:
      - arcane-cli
    vendor: getarcaneapp
    description: |-
      Arcane CLI - {{ .Metadata.Description }}
      This is the command-line interface for Arcane.
    formats:
      - apk
      - deb
      - rpm
      - archlinux
    bindir: /usr/bin
    contents:
      - src: ./cli/README.md
        dst: '/usr/share/doc/{{ if eq (index .Env "BUILD_NEXT") "true" }}arcane-cli-next{{ else }}arcane-cli{{ end }}/README.md'
      - src: ./LICENSE
        dst: '/usr/share/doc/{{ if eq (index .Env "BUILD_NEXT") "true" }}arcane-cli-next{{ else }}arcane-cli{{ end }}/LICENSE'

publishers:
  - name: nexus-debian
    if: '{{ eq .ArtifactExt ".deb" }}'
    disable: '{{ if not (and (index .Env "NEXUS_USERNAME") (index .Env "NEXUS_PASSWORD")) }}true{{ end }}'
    dir: '{{ dir .ArtifactPath }}'
    cmd: >-
      curl --fail-with-body
      -u "{{ .Env.NEXUS_USERNAME }}:{{ .Env.NEXUS_PASSWORD }}"
      -X POST
      -H "Content-Type: multipart/form-data"
      --data-binary "@{{ .ArtifactName }}"
      'https://pkgs.getarcane.app/repository/debian/'

  - name: nexus-yum
    if: '{{ eq .ArtifactExt ".rpm" }}'
    disable: '{{ if not (and (index .Env "NEXUS_USERNAME") (index .Env "NEXUS_PASSWORD")) }}true{{ end }}'
    dir: '{{ dir .ArtifactPath }}'
    cmd: >-
      curl --fail-with-body
      -u "{{ .Env.NEXUS_USERNAME }}:{{ .Env.NEXUS_PASSWORD }}"
      --upload-file "{{ .ArtifactName }}"
      'https://pkgs.getarcane.app/repository/yum/{{- if eq .Arch "amd64" -}}x86_64{{- else if eq .Arch "arm64" -}}aarch64{{- else if eq .Arch "386" -}}i386{{- else if and (eq .Arch "arm") (eq .Arm "7") -}}armhfp{{- else -}}{{ .Arch }}{{- end -}}/{{ .ArtifactName }}'

  - name: nexus-alpine
    if: '{{ eq .ArtifactExt ".apk" }}'
    disable: '{{ if not (and (index .Env "NEXUS_USERNAME") (index .Env "NEXUS_PASSWORD")) }}true{{ end }}'
    dir: '{{ dir .ArtifactPath }}'
    cmd: >-
      curl --fail-with-body
      -u "{{ .Env.NEXUS_USERNAME }}:{{ .Env.NEXUS_PASSWORD }}"
      --upload-file "{{ .ArtifactName }}"
      'https://pkgs.getarcane.app/repository/alpine/stable/main/{{- if eq .Arch "amd64" -}}x86_64{{- else if eq .Arch "arm64" -}}aarch64{{- else if eq .Arch "386" -}}x86{{- else if and (eq .Arch "arm") (eq .Arm "7") -}}armv7{{- else -}}{{ .Arch }}{{- end -}}/{{ .ArtifactName }}'

homebrew_casks:
  - name: arcane-cli
    ids:
      - arcane-cli-archive
    binaries:
      - arcane-cli
    generate_completions_from_executable:
      executable: arcane-cli
      shell_parameter_format: cobra
      shells:
        - bash
        - zsh
        - fish
        - pwsh
    description: 'Arcane CLI - {{ .Metadata.Description }}'
    skip_upload: '{{ if eq (index .Env "BUILD_NEXT") "true" }}true{{ end }}'
    repository:
      owner: getarcaneapp
      name: homebrew-tap
    commit_msg_template: 'chore(brew): update {{ .ProjectName }} to {{ .Tag }}'

dockers_v2:
  - id: arcane-image
    ids:
      - arcane
    dockerfile: docker/Dockerfile-static
    images:
      - ghcr.io/getarcaneapp/manager
    tags:
      - '{{ if index .Env "BUILD_NEXT" }}next{{ end }}'
      - 'v{{ .Version }}'
      - '{{ if not (index .Env "BUILD_NEXT") }}v{{ .Major }}.{{ .Minor }}{{ end }}'
      - '{{ if not (index .Env "BUILD_NEXT") }}v{{ .Major }}{{ end }}'
      - '{{ if not (index .Env "BUILD_NEXT") }}latest{{ end }}'
    platforms:
      - linux/amd64
      - linux/arm64
      - linux/arm/v7
      - linux/riscv64
    labels:
      'org.opencontainers.image.authors': 'Arcane Organization'
      'org.opencontainers.image.url': 'https://github.com/getarcaneapp/arcane'
      'org.opencontainers.image.documentation': 'https://github.com/getarcaneapp/arcane/blob/main/README.md'
      'org.opencontainers.image.source': 'https://github.com/getarcaneapp/arcane'
      'org.opencontainers.image.version': 'v{{.Version}}'
      'org.opencontainers.image.revision': '{{.FullCommit}}'
      'org.opencontainers.image.licenses': '{{ .Metadata.License }}'
      'org.opencontainers.image.title': 'Arcane'
      'org.opencontainers.image.description': '{{ .Metadata.Description }}'
      'com.getarcaneapp.arcane': 'true'
    sbom: '{{ if eq (index .Env "BUILD_NEXT") "true" }}false{{ else }}true{{ end }}'

  - id: arcane-agent-image
    ids:
      - arcane-agent
    dockerfile: docker/Dockerfile-agent-static
    images:
      - ghcr.io/getarcaneapp/agent
    tags:
      - '{{ if index .Env "BUILD_NEXT" }}next{{ end }}'
      - 'v{{ .Version }}'
      - '{{ if not (index .Env "BUILD_NEXT") }}v{{ .Major }}.{{ .Minor }}{{ end }}'
      - '{{ if not (index .Env "BUILD_NEXT") }}v{{ .Major }}{{ end }}'
      - '{{ if not (index .Env "BUILD_NEXT") }}latest{{ end }}'
    platforms:
      - linux/amd64
      - linux/arm64
      - linux/arm/v7
      - linux/riscv64
    labels:
      'org.opencontainers.image.authors': 'Arcane Organization'
      'org.opencontainers.image.url': 'https://github.com/getarcaneapp/arcane'
      'org.opencontainers.image.documentation': 'https://github.com/getarcaneapp/arcane/blob/main/README.md'
      'org.opencontainers.image.source': 'https://github.com/getarcaneapp/arcane'
      'org.opencontainers.image.version': 'v{{.Version}}'
      'org.opencontainers.image.revision': '{{.FullCommit}}'
      'org.opencontainers.image.licenses': '{{ .Metadata.License }}'
      'org.opencontainers.image.title': 'Arcane Agent'
      'org.opencontainers.image.description': 'Arcanes Remote Agent'
      'com.getarcaneapp.arcane.agent': 'true'
    sbom: '{{ if eq (index .Env "BUILD_NEXT") "true" }}false{{ else }}true{{ end }}'

docker_signs:
  - cmd: cosign
    ids:
      - arcane-image
      - arcane-agent-image
    args:
      - sign
      - --key=env://COSIGN_PRIVATE_KEY
      - '${artifact}@${digest}'
      - --yes
    output: true

blobs:
  - provider: s3
    endpoint: '{{ index .Env "R2_ENDPOINT" }}'
    region: auto
    bucket: '{{ index .Env "R2_BUCKET" }}'
    directory: bin/cli-next
    ids:
      - arcane-cli-binary
    if: '{{ eq .ArtifactID "arcane-cli-binary" }}'
    extra_files:
      - glob: dist/arcane_*_checksums.txt
        name_template: arcane-cli_checksums.txt
      - glob: dist/arcane_*_checksums.txt.sigstore.json
        name_template: arcane-cli_checksums.txt.sigstore.json
    include_meta: false
    disable: '{{ if not (index .Env "BUILD_NEXT") }}true{{ end }}'

  - provider: s3
    endpoint: '{{ index .Env "R2_ENDPOINT" }}'
    region: auto
    bucket: '{{ index .Env "R2_BUCKET" }}'
    ids:
      - default
    directory: bin/arcane-next
    extra_files:
      - glob: dist/arcane_*_checksums.txt
        name_template: arcane_checksums.txt
      - glob: dist/arcane_*_checksums.txt.sigstore.json
        name_template: arcane_checksums.txt.sigstore.json
    include_meta: false
    disable: '{{ if not (index .Env "BUILD_NEXT") }}true{{ end }}'

changelog:
  disable: '{{ if isEnvSet "SKIP_CHANGELOG" }}true{{ else if isEnvSet "OPENAI_API_KEY" }}false{{ else }}true{{ end }}'
  use: github
  filters:
    include:
      - '^feat'
      - '^fix'
      - '^perf'
      - '^docs'
      - '^refactor'
      - '^test'
      - '^style'
      - '^build'
      - '^ci'
      - '^revert'
  ai:
    use: openai
    model: openai/gpt-6-luna-pro
    prompt: |
      Rewrite these release notes for Arcane, a Docker management app.
      Start with a short intro highlighting the most notable changes, wrapped
      in a GitHub alert blockquote (a "> [!NOTE]" line followed by "> " prefixed
      lines). The intro's first sentence must begin with "This release adds" or
      "This release fixes". Group related changes and keep it concise. Keep each entry's pull
      request or commit reference and its author attribution. No emojis.

      {{ .ReleaseNotes }}

announce:
  discord:
    enabled: true
    message_template: 'Arcane version {{.Tag}} has been released! Checkout the changelog at {{ .ReleaseURL }}'
    author: 'Github Actions'
    # Color code of the embed. You have to use decimal numeral system, not hexadecimal.
    color: '9320959'
    icon_url: 'https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png'

release:
  ids:
    - default
    - arcane-cli-archive
    - arcane-cli
    - cosign-checksums
  github:
    owner: getarcaneapp
    name: arcane
  disable: '{{ if index .Env "SKIP_RELEASE" }}true{{ end }}'
  draft: true
  replace_existing_draft: false
  use_existing_draft: true
  replace_existing_artifacts: true
  prerelease: auto
  make_latest: true
  mode: replace
  name_template: '{{.Tag}}'