-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: (╯°□°)╯︵ uᴉǝssnH ɐɟɐʇsoW <[email protected]>
- Loading branch information
1 parent
438280c
commit b871f12
Showing
27 changed files
with
1,817 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: build | ||
on: | ||
push: | ||
branches-ignore: | ||
- 'v**' | ||
pull_request: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: 'true' | ||
- run: git fetch --prune --unshallow | ||
- name: setup dependencies | ||
uses: actions/setup-go@v2 | ||
- name: build | ||
run: make build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: release | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: 'true' | ||
- run: git fetch --prune --unshallow | ||
- name: setup dependencies | ||
uses: actions/setup-go@v2 | ||
- name: release dry run | ||
run: make release-dry-run | ||
- name: setup release environment | ||
run: |- | ||
echo 'GITHUB_TOKEN=${{secrets.GORELEASER_ACCESS_TOKEN}}' > .release-env | ||
- name: release publish | ||
run: make release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
*.test | ||
|
||
*.out | ||
|
||
go.work | ||
|
||
.idea/* | ||
|
||
dist/ | ||
|
||
.release-env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
before: | ||
hooks: | ||
- go mod tidy | ||
builds: | ||
- id: darwin-amd64 | ||
main: ./ | ||
binary: conceal | ||
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 conceal/internal/config.Version={{.Version}} | ||
- id: darwin-arm64 | ||
main: ./ | ||
binary: conceal | ||
goos: | ||
- darwin | ||
goarch: | ||
- arm64 | ||
env: | ||
- PKG_CONFIG_SYSROOT_DIR=/sysroot/macos/arm64 | ||
- PKG_CONFIG_PATH=/sysroot/macos/arm64/usr/local/lib/pkgconfig | ||
- CC=o64-clang | ||
- CXX=o64-clang++ | ||
flags: | ||
- -mod=readonly | ||
ldflags: | ||
- -s -w -X conceal/internal/config.Version={{.Version}} | ||
- id: linux-amd64 | ||
main: ./ | ||
binary: conceal | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
env: | ||
- PKG_CONFIG_SYSROOT_DIR=/sysroot/linux/amd64 | ||
- PKG_CONFIG_PATH=/sysroot/linux/amd64/usr/local/lib/pkgconfig | ||
- CC=gcc | ||
- CXX=g++ | ||
flags: | ||
- -mod=readonly | ||
ldflags: | ||
- -s -w -X conceal/internal/config.Version={{.Version}} | ||
- id: linux-arm64 | ||
main: ./ | ||
binary: conceal | ||
goos: | ||
- linux | ||
goarch: | ||
- arm64 | ||
env: | ||
- PKG_CONFIG_SYSROOT_DIR=/sysroot/linux/arm64 | ||
- PKG_CONFIG_PATH=/sysroot/linux/arm64/usr/local/lib/pkgconfig | ||
- CC=aarch64-linux-gnu-gcc | ||
- CXX=aarch64-linux-gnu-g++ | ||
flags: | ||
- -mod=readonly | ||
ldflags: | ||
- -s -w -X conceal/internal/config.Version={{.Version}} | ||
- id: linux-armhf | ||
main: ./ | ||
binary: conceal | ||
goos: | ||
- linux | ||
goarch: | ||
- arm | ||
goarm: | ||
- 7 | ||
env: | ||
- CC=arm-linux-gnueabihf-gcc | ||
- CXX=arm-linux-gnueabihf-g++ | ||
- CGO_CFLAGS=--sysroot=/sysroot/linux/armhf | ||
- CGO_LDFLAGS=--sysroot=/sysroot/linux/armhf | ||
- PKG_CONFIG_SYSROOT_DIR=/sysroot/linux/armhf | ||
- PKG_CONFIG_PATH=/sysroot/linux/armhf/opt/vc/lib/pkgconfig:/sysroot/linux/armhf/usr/lib/arm-linux-gnueabihf/pkgconfig:/sysroot/linux/armhf/usr/lib/pkgconfig:/sysroot/linux/armhf/usr/local/lib/pkgconfig | ||
flags: | ||
- -mod=readonly | ||
ldflags: | ||
- -s -w -X conceal/internal/config.Version={{.Version}} | ||
archives: | ||
- id: conceal | ||
builds: | ||
- darwin-amd64 | ||
- darwin-arm64 | ||
- linux-amd64 | ||
- linux-arm64 | ||
- linux-armhf | ||
name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}" | ||
format: binary | ||
wrap_in_directory: true | ||
files: [] | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ incpatch .Version }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
PACKAGE_NAME := github.com/conceal-cli/cli | ||
GOLANG_CROSS_VERSION ?= v1.19.3 | ||
|
||
SYSROOT_DIR ?= sysroots | ||
SYSROOT_ARCHIVE ?= sysroots.tar.bz2 | ||
|
||
.PHONY: sysroot-pack | ||
sysroot-pack: | ||
@tar cf - $(SYSROOT_DIR) -P | pv -s $[$(du -sk $(SYSROOT_DIR) | awk '{print $1}') * 1024] | pbzip2 > $(SYSROOT_ARCHIVE) | ||
|
||
.PHONY: sysroot-unpack | ||
sysroot-unpack: | ||
@pv $(SYSROOT_ARCHIVE) | pbzip2 -cd | tar -xf - | ||
|
||
.PHONY: build | ||
build: | ||
@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) \ | ||
goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \ | ||
--rm-dist --skip-validate --skip-publish --snapshot | ||
|
||
.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) \ | ||
goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \ | ||
--rm-dist --skip-validate --skip-publish | ||
|
||
.PHONY: release | ||
release: | ||
@if [ ! -f ".release-env" ]; then \ | ||
echo "\033[91m.release-env is required for release\033[0m";\ | ||
exit 1;\ | ||
fi | ||
docker run \ | ||
--rm \ | ||
-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) \ | ||
goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \ | ||
release --rm-dist |
Oops, something went wrong.