-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit including building script and submodules for percona-t…
…oolkit and pmm-dump
- Loading branch information
0 parents
commit cab2a80
Showing
5 changed files
with
90 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,46 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ^1.20.3 | ||
|
||
- name: Build | ||
run: ./build | ||
env: | ||
CGO_ENABLED: 0 | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload binaries to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: dist/* | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
file_glob: true | ||
|
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,6 @@ | ||
[submodule "percona-toolkit"] | ||
path = percona-toolkit | ||
url = https://github.com/percona/percona-toolkit | ||
[submodule "pmm-dump"] | ||
path = pmm-dump | ||
url = https://github.com/percona/pmm-dump |
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,36 @@ | ||
#!/usr/bin/bash | ||
|
||
OS=( linux windows darwin ) | ||
ARCH=( amd64 arm arm64 ) | ||
|
||
test -d dist || mkdir dist | ||
|
||
function d { | ||
echo "[ $(date) ] $1" | ||
} | ||
|
||
function ldflags { | ||
BRANCH=$(git branch --show-current) | ||
COMMIT=$(git rev-parse --short HEAD) | ||
VERSION=$(git describe --tags --abbrev=0) | ||
echo "-X 'main.GitBranch=${BRANCH}' -X 'main.GitCommit=${COMMIT}' -X 'main.GitVersion=${VERSION}'" | ||
} | ||
|
||
for os_ in ${OS[@]}; do | ||
for arch_ in ${ARCH[@]}; do | ||
test $( go tool dist list | grep -wc $os_/$arch_ ) -ne 1 && continue | ||
test "$os_/$arch_" == "windows/arm" && continue; | ||
cd pmm-dump | ||
d "Building pmm-dump on $os_/$arch_" | ||
GOOS=${os_} GOARCH=${arch_} go build -ldflags "$(ldflags)" -o ../dist/pmm-dump.${os_}.${arch_} pmm-dump/cmd/pmm-dump | ||
cd .. | ||
|
||
cd percona-toolkit/src/go | ||
|
||
for pkg in pt-k8s-debug-collector pt-mongodb-index-check pt-mongodb-query-digest pt-mongodb-summary pt-pg-summary pt-secure-collect; do | ||
d "Building $pkg on $os_/$arch_" | ||
GOOS=${os_} GOARCH=${arch_} go build -ldflags "$(ldflags)" -o ../../../dist/${pkg}.${os_}.${arch_} ./${pkg} | ||
done; | ||
cd ../../.. | ||
done; | ||
done; |
Submodule percona-toolkit
added at
28fbbc