forked from zilliztech/milvus-cdc
-
Notifications
You must be signed in to change notification settings - Fork 0
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: zhuwenxing <wenxing.zhu@zilliz.com>
- Loading branch information
1 parent
8a9d8b9
commit 5224722
Showing
3 changed files
with
205 additions
and
0 deletions.
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,112 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build-linux-binary: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- run: git fetch --force --tags | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
cache: true | ||
|
||
- uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
# either 'goreleaser' (default) or 'goreleaser-pro': | ||
distribution: goreleaser | ||
workdir: ./server | ||
version: latest | ||
args: release --skip-publish --config .goreleaser-linux.yaml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
- name: Upload | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: milvus-cdc-linux | ||
path: | | ||
dist/milvus-cdc* | ||
dist/checksums.txt | ||
build-darwin-binary: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- run: git fetch --force --tags | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
cache: true | ||
|
||
- uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
# either 'goreleaser' (default) or 'goreleaser-pro': | ||
distribution: goreleaser | ||
workdir: ./server | ||
version: latest | ||
args: release --skip-publish --config .goreleaser-darwin.yaml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
- name: Upload | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: milvus-cdc-darwin | ||
path: | | ||
server/dist/milvus-cdc* | ||
server/dist/checksums.txt | ||
merge-and-release: | ||
needs: [build-linux-binary, build-darwin-binary] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- run: git fetch --force --tags | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
cache: true | ||
- name: Make directories | ||
run: | | ||
mkdir -p ./milvus-cdc-build/linux | ||
mkdir -p ./milvus-cdc-build/darwin | ||
- name: Download linux binaries | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: milvus-cdc-linux | ||
path: ./milvus-cdc-build/linux | ||
- name: Download darwin binaries | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: milvus-cdc-darwin | ||
path: ./milvus-cdc-build/darwin | ||
- name: Merge checksum file | ||
run: | | ||
cd ./milvus-cdc-build | ||
cat ./darwin/checksums.txt >> checksums.txt | ||
cat ./linux/checksums.txt >> checksums.txt | ||
rm ./darwin/checksums.txt | ||
rm ./linux/checksums.txt | ||
- name: Check git status | ||
run: | | ||
tree | ||
git status | ||
- name: Release | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
args: release --clean --config .goreleaser-release.yaml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} |
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,44 @@ | ||
# This is an example .goreleaser.yml file with some sensible defaults. | ||
# Make sure to check the documentation at https://goreleaser.com | ||
before: | ||
hooks: | ||
# You may remove this if you don't use go modules. | ||
- go mod tidy | ||
# you may remove this if you don't need go generate | ||
# - go generate ./... | ||
builds: | ||
- | ||
main: ./main | ||
env: | ||
- CGO_ENABLED=1 | ||
goos: | ||
- darwin | ||
archives: | ||
- format: tar.gz | ||
# this name template makes the OS and Arch compatible with the results of uname. | ||
name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- title .Os }}_ | ||
{{- if eq .Arch "amd64" }}x86_64 | ||
{{- else if eq .Arch "386" }}i386 | ||
{{- else }}{{ .Arch }}{{ end }} | ||
{{- if .Arm }}v{{ .Arm }}{{ end }} | ||
# use zip for windows archives | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ incpatch .Version }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
|
||
# The lines beneath this are called `modelines`. See `:help modeline` | ||
# Feel free to remove those if you don't want/use them. | ||
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json | ||
# vim: set ts=2 sw=2 tw=0 fo=cnqoj |
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,49 @@ | ||
# This is an example .goreleaser.yml file with some sensible defaults. | ||
# Make sure to check the documentation at https://goreleaser.com | ||
before: | ||
hooks: | ||
# You may remove this if you don't use go modules. | ||
- go mod tidy | ||
# you may remove this if you don't need go generate | ||
#- go generate ./... | ||
builds: | ||
- | ||
main: ./main | ||
env: | ||
- CGO_ENABLED=1 | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
overrides: | ||
- goos: linux | ||
goarch: amd64 | ||
env: | ||
- CC=gcc | ||
ldflags: | ||
- -extldflags "-static" | ||
archives: | ||
- format: tar.gz | ||
# this name template makes the OS and Arch compatible with the results of uname. | ||
name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- title .Os }}_ | ||
{{- if eq .Arch "amd64" }}x86_64 | ||
{{- else if eq .Arch "386" }}i386 | ||
{{- else }}{{ .Arch }}{{ end }} | ||
{{- if .Arm }}v{{ .Arm }}{{ end }} | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ incpatch .Version }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
|
||
# The lines beneath this are called `modelines`. See `:help modeline` | ||
# Feel free to remove those if you don't want/use them. | ||
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json | ||
# vim: set ts=2 sw=2 tw=0 fo=cnqoj |