Giter VIP home page Giter VIP logo

goreleaser-cross-compile's Introduction

goreleaser-cross-compile

Description

This repository extends the cross-compile docker image for goreleaser to build the fylr application.

Tag schema

Tags follow the [origin version scheme] (https://github.com/goreleaser/goreleaser-cross/releases) with one exception:

Versions that follow the vX.X.X-X scheme are intended as patches for the origin vX.X.X version

Updating this to a newer version

  1. at least update the versions in Makefile

  2. make a release in this repository with a new tag, syntax as the other existing releases

Using our variant of goreleaser-cross

  1. Place a .goreleaser.yml file in the root of the repository you want to use it in. See .goreleaser.yml in fylr if you have access. Otherwise: Example:
before:
  hooks:
    - make generate
    - go mod tidy

builds:
  - id: fylr-build-darwin-amd64
    binary: example
    env:
      - CGO_ENABLED=1
      - CC=o64-clang
      - CXX=o64-clang++
    main: .
    goos:
      - darwin
    goarch:
      - amd64
    ldflags:
      - -s -w -X main.buildCommit=${GIT_COMMIT_SHA} -X main.buildTime=${BUILD_TIME} -X main.buildVersion={{.Version}}

  - id: fylr-build-darwin-arm64
    binary: example
    env:
      - CGO_ENABLED=1
      - CC=aarch64-apple-darwin20.2-clang
      - CXX=aarch64-apple-darwin20.2-clang++
    main: .
    goos:
      - darwin
    goarch:
      - arm64
    ldflags:
      - -s -w -X main.buildCommit=${GIT_COMMIT_SHA} -X main.buildTime=${BUILD_TIME} -X main.buildVersion={{.Version}}

  - id: fylr-build-linux
    binary: example
    env:
      - CGO_ENABLED=1
    main: .
    goos:
      - linux
    goarch:
      - amd64
    ldflags:
      - -s -w -X main.buildCommit=${GIT_COMMIT_SHA} -X main.buildTime=${BUILD_TIME} -X main.buildVersion={{.Version}}

  - id: fylr-build-windows-x64
    binary: example
    env:
      - CGO_ENABLED=1
      - CC=x86_64-w64-mingw32-gcc
      - CXX=x86_64-w64-mingw32-g++
    main: .
    goos:
      - windows
    goarch:
      - amd64
    ldflags:
      - -s -w -X main.buildCommit=${GIT_COMMIT_SHA} -X main.buildTime=${BUILD_TIME} -X main.buildVersion={{.Version}} -buildmode=exe

archives:
- format: tar.gz
  format_overrides:
    - goos: windows
      format: zip
  name_template: "{{ .Binary }}_v{{ .Version }}_{{ .ShortCommit }}_{{ .Os }}_{{ .Arch }}"
  replacements:
    amd64: x64
    arm64: ARM64
    darwin: macOS
    linux: Linux
    windows: Windows
  allow_different_binary_count: true

release:
  draft: true
  prerelease: auto
  name_template: "Release {{.Tag}}"

checksum:
  name_template: "{{ .ProjectName }}_checksums.txt"

snapshot:
  name_template: SNAPSHOT-{{.ShortCommit}}

changelog:
  use: github
  sort: asc
  groups:
    - title: Features
      regexp: "^.*feat[(\\w)]*:+.*$"
      order: 0
    - title: "Bug fixes"
      regexp: "^.*fix[(\\w)]*:+.*$"
      order: 1
    - title: "Enhancements"
      regexp: "^.*enhancement[(\\w)]*:+.*$"
      order: 2
    - title: Others
      order: 999
  filters:
    exclude:
      - "^docs:"
      - "^test:"
      - "^github:"
      - "^ci:"
      - "^cd:"
      - "^ci/cd:"
      - "^example:"
      - "^gomod:"
      - "^git:"
      - "^goreleaser:"
      - "^Merge branch"
      - "WIP"
  1. run goreleaser-cross

in this example: a snapshot (--snapshot)

docker run \
    --rm \
    --privileged \
    -e CGO_ENABLED=1 \
    --env-file .release-env \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v `pwd`:/go/src/$(PACKAGE_NAME) \
    -v `pwd`/sysroot:/sysroot \
    -w /go/src/$(PACKAGE_NAME) \
    docker.fylr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
    release --rm-dist --snapshot

goreleaser-cross-compile's People

Contributors

leonsteinhaeuser avatar klausthornprogrammfabrik avatar mad-pf avatar martinrode avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.