Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
on:
pull_request:
branches:
- master

permissions:
contents: write # needed to write releases

name: Build
jobs:
test-releaser:
runs-on: ubuntu-latest
steps:
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: 1.23.x
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # this is important, otherwise it won't checkout the full tree (i.e. no previous tags)
- name: Build
env:
PACKAGE_NAME: github.com/lets-cli/lets
GOLANG_CROSS_VERSION: v1.23
run: |
docker run \
--rm \
-e CGO_ENABLED=1 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/${PACKAGE_NAME}\
-v `pwd`/sysroot:/sysroot \
-w /go/src/${PACKAGE_NAME} \
ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
--clean --skip=validate --skip=publish --snapshot
# - name: Releaser build
# uses: goreleaser/goreleaser-action@v4
# with:
# distribution: goreleaser
# version: v2.6.1
# args: build --clean --skip=validate --snapshot --single-target
# env:
# GOOS: darwin
# GOARCH: amd64
# ZIG_LOCAL_CACHE_DIR: ${{ steps.set_env.outputs.current_dir }}
# ZIG_GLOBAL_CACHE_DIR: ${{ steps.set_env.outputs.current_dir }}
# SDK_PATH: ${{ steps.set_env.outputs.sdk_path }}
56 changes: 0 additions & 56 deletions .github/workflows/test.yaml

This file was deleted.

59 changes: 46 additions & 13 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,52 @@ release:
prerelease: auto

builds:
- env:
- CGO_ENABLED=1
goos:
- linux
- darwin
goarch:
- amd64
- arm64
ignore:
- goos: linux
goarch: arm64
ldflags:
- -X main.version={{.Version}}
- id: darwin-amd64
main: .
binary: golang-cross
goos:
- darwin
goarch:
- amd64
env:
- PKG_CONFIG_SYSROOT_DIR=/sysroot/macos/amd64
- PKG_CONFIG_PATH=/sysroot/macos/amd64/usr/local/lib/pkgconfig
- CC=o64-clang
- CXX=o64-clang++
flags:
- -mod=readonly
ldflags:
- -s -w -X main.version={{.Version}}
- id: darwin-arm64
main: .
binary: golang-cross
goos:
- darwin
goarch:
- arm64
env:
- PKG_CONFIG_SYSROOT_DIR=/sysroot/macos/arm64
- PKG_CONFIG_PATH=/sysroot/macos/arm64/usr/local/lib/pkgconfig
- CC=oa64-clang
- CXX=oa64-clang++
flags:
- -mod=readonly
ldflags:
- -s -w -X main.version={{.Version}}
- id: linux-amd64
main: .
binary: golang-cross
goos:
- linux
goarch:
- amd64
env:
- CC=x86_64-linux-gnu-gcc
- CXX=x86_64-linux-gnu-g++
flags:
- -mod=readonly
ldflags:
- -s -w -X main.version={{.Version}}

archives:
- formats: [tar.gz]
Expand Down