Skip to content

Commit

Permalink
build: Test goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
opaoz committed Jun 23, 2024
1 parent 7a173d7 commit dc69305
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: release
on:
push:
branches:
- "buildsystem"

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- run: git fetch --prune --unshallow
- name: setup dependencies
uses: actions/setup-go@v2
- name: release dry run
run: make release-dry-run
75 changes: 75 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
project_name: pug-lsp
env:
- CO111MODULE=on
- CGO_ENABLED=1
builds:
- id: darwin-amd64
binary: pug-lsp
main: ./main.go
goarch:
- amd64
goos:
- darwin
env:
- CC=o64-clang
- CXX=o64-clang++
flags:
- "-mod={{ .Env.MOD }}"
- "-tags={{ .Env.BUILD_TAGS }}"
- -trimpath
ldflags:
- "{{ .Env.BUILD_VARS }}"
- "{{ .Env.STRIP_FLAGS }}"
- "-linkmode={{ .Env.LINKMODE }}"
- id: darwin-arm64
binary: pug-lsp
main: ./main.go
goarch:
- arm64
goos:
- darwin
env:
- CC=oa64-clang
- CXX=oa64-clang++
flags:
- "-mod={{ .Env.MOD }}"
- "-tags={{ .Env.BUILD_TAGS }}"
- -trimpath
ldflags:
- "{{ .Env.BUILD_VARS }}"
- "{{ .Env.STRIP_FLAGS }}"
- "-linkmode={{ .Env.LINKMODE }}"
universal_binaries:
- id: darwin-universal
ids:
- darwin-amd64
- darwin-arm64
replace: true
name_template: "pug-lsp"
archives:
- format: zip
id: w/version
builds:
- darwin-universal
- darwin-amd64
- darwin-arm64
name_template: "pug-lsp_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
wrap_in_directory: false
- format: zip
id: wo/version
builds:
- darwin-universal
- darwin-amd64
- darwin-arm64
name_template: "pug-lsp_{{ .Os }}_{{ .Arch }}"
wrap_in_directory: false
checksum:
name_template: "pug-lsp_{{ .Version }}_checksums.txt"

release:
mode: replace
github:
owner: opa-oz
name: pug-lsp
prerelease: auto
draft: true
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
PACKAGE_NAME := github.com/opa-oz/pug-lsp
GOLANG_CROSS_VERSION ?= v1.21.5

.PHONY: help

help:
Expand All @@ -23,3 +26,15 @@ toc: ## Format README.md to add TOC
markdown-toc -i README.md

.PHONY: toc

.PHONY: release-dry-run
release-dry-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

0 comments on commit dc69305

Please sign in to comment.