Skip to content
🎉 GoReleaser v2.18 is out! with release summaries, preflight checks, OpenTelemetry traces, and more!

Arch User Repositories (Sources)

Since v2.5.

After releasing to GitHub, GitLab, or Gitea, GoReleaser can generate and publish a PKGBUILD to an Arch User Repository based on sources.

Warning

Before going further on this, make sure to read AUR’s Submission Guidelines.

This page describes the available options.

.goreleaser.yaml
aur_sources:
  - # The package name.
    #
    # Note that since this integration creates a PKGBUILD to build from
    # source, per Arch's guidelines.
    # That said, GoReleaser will remove `-bin` suffix if its present.
    #
    # Default: ProjectName.
    name: package

    # Artifact IDs to filter for.
    # Empty means all IDs (no filter).
    ids:
      - foo
      - bar

    # Your app's homepage.
    #
    # Default: inferred from global metadata.
    homepage: "https://example.com/"

    # Your app's description.
    #
    # Templates: allowed.
    # Default: inferred from global metadata.
    description: "Software to create fast and easy drum rolls."

    # The maintainers of the package.
    #
    # Default: inferred from global metadata.
    maintainers:
      - "Foo Bar <foo at bar dot com>"

    # The contributors of the package.
    contributors:
      - "Foo Zaz <foo at zaz dot com>"

    # SPDX identifier of your app's license.
    #
    # Default: inferred from global metadata.
    license: "MIT"

    # The architectures to build the package for.
    #
    # Default: [ 'x86_64', 'aarch64' ].
    arches:
      - x86_64
      - aarch64

    # The SSH private key that should be used to commit to the Git repository.
    # This can either be a path or the key contents.
    #
    # IMPORTANT: the key must not be password-protected.
    #
    # WARNING: do not expose your private key in the configuration file!
    private_key: "{{ .Env.AUR_KEY }}"

    # The AUR Git URL for this package.
    # Publish is skipped if empty.
    git_url: "ssh://[email protected]/mypackage.git"

    # Setting this will prevent goreleaser to actually try to commit the updated
    # formula - instead, the formula file will be stored on the dist directory
    # only, leaving the responsibility of publishing it to the user.
    #
    # If set to auto, the release will not be uploaded to the AUR repo
    # in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1.
    skip_upload: true

    # List of additional packages that the software provides the features of.
    #
    # Default: the project name.
    provides:
      - myapp

    # List of packages that conflict with, or cause problems with the package.
    #
    # Default: the project name.
    conflicts:
      - myapp

    # List of packages that must be installed to install this.
    depends:
      - curl

    # List of packages that are not needed for the software to function,
    # but provide additional features.
    #
    # Must be in the format `package: short description of the extra functionality`.
    optdepends:
      - "wget: for downloading things"

    # List of packages that must be installed to build this.
    # Default: ["go", "git"]
    makedepends:
      - make

    # List of files that can contain user-made changes and should be preserved
    # during package upgrades and removals.
    backup:
      - /etc/foo.conf

    # The release number of the package (the `pkgrel` field in the PKGBUILD).
    #
    # Default: '1'.
    rel: "1"

    # Custom prepare instructions.
    prepare: |-
      cd "${pkgname}_${pkgver}"
      go mod download

    # Custom build instructions.
    build: |-
      cd "${pkgname}_${pkgver}"
      export CGO_CPPFLAGS="${CPPFLAGS}"
      export CGO_CFLAGS="${CFLAGS}"
      export CGO_CXXFLAGS="${CXXFLAGS}"
      export CGO_LDFLAGS="${LDFLAGS}"
      export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
      go build -ldflags="-w -s -buildid='' -linkmode=external -X main.version=${pkgver}" .
      chmod +x ./goreleaser

    # Custom package instructions.
    package: |-
      cd "${pkgname}_${pkgver}"
      install -Dsm755 ./myapp "${pkgdir}/usr/bin/myapp"

    # This will be added into the package as 'name.install'.
    # In this file, you may define functions like `pre_install`, `post_install`,
    # and so on.
    #
    # 
Since v2.8
install: ./scripts/install.sh # Commit message. # # Default: 'Update to {{ .Tag }}'. # Templates: allowed. commit_msg_template: "pkgbuild updates" # If you build for multiple GOAMD64 versions, you may use this to choose which one to use. # # Default: 'v1'. goamd64: v2 # The value to be passed to `GIT_SSH_COMMAND`. # This is mainly used to specify the SSH private key used to pull/push to # the Git URL. # # Default: 'ssh -i {{ .KeyPath }} -o StrictHostKeyChecking=accept-new -F /dev/null'. git_ssh_command: "ssh -i {{ .Env.KEY }} -o SomeOption=yes" # URL which is determined by the given Token # (github, gitlab or gitea). # # Default: depends on the client. # Templates: allowed. url_template: "http://github.mycompany.com/foo/bar/releases/{{ .Tag }}/{{ .ArtifactName }}" # Directory in which the files will be created inside the repository. # Only useful if you're creating your own AUR with multiple packages in a # single repository. # # Default: '.'. # Templates: allowed. directory: "." # Whether to disable this particular AUR configuration. # # Templates: allowed. #
Since v2.8
disable: "{{ .IsSnapshot }}" # Git author used to commit to the repository. # # Default: inferred from global metadata.
Since v2.12
commit_author: # Git author name. # # Templates: allowed. name: goreleaserbot # Git author email. # # Templates: allowed. email: [email protected] # Use GitHub App token for signed commits. # When enabled, the committer field is omitted from API calls, # allowing GitHub to automatically sign commits with the GitHub App identity. # See: https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification#signature-verification-for-bots # #
Since v2.13
# Default: false. use_github_app_token: false # Git commit signing configuration. # Only useful if repository is of type 'git'. # #
Since v2.11
signing: # Enable commit signing. enabled: true # The signing key to use. # Can be a key ID, fingerprint, email address, or path to a key file. # # Templates: allowed. key: "{{ .Env.GPG_SIGNING_KEY }}" # The GPG program to use for signing. # # Templates: allowed. program: gpg2 # The signature format to use. # # Valid options: openpgp, x509, ssh. # Default: openpgp. format: openpgp
Learn more about the template language.

Note

For more info about what each field does, please refer to Arch’s PKGBUILD reference.

Last updated on