Skip to content
Merged
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
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,16 @@ jobs:

build:
runs-on: ubuntu-latest
env:
PRE_DEF_VERSION: ${{ inputs.update_dedicated_image && 'v8.5.0' || 'v7.1.0' }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: 1.23

- name: Build
run: VERSION="$PRE_DEF_VERSION" make
run: make

- name: Test
run: make test
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release

on:
push:
tags:
- "v*.*.*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.23

- name: Create the build tarball
run: make xz_release

- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
This is the release for version ${{ github.ref }}.
files: |
./bin/xz/*
LICENSE
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 18 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,24 @@ FILES := $$(find . -name "*.go")
default:
$(GOBUILD) -o bin/tiflash-ctl

arm:
GOOS=linux GOARCH=arm64 $(GOBUILD) -o bin/tiflash-ctl-arm
release_all:
GOOS=linux GOARCH=amd64 $(GOBUILD) -o bin/tiflash-ctl-linux-amd64
GOOS=linux GOARCH=arm64 $(GOBUILD) -o bin/tiflash-ctl-linux-arm64

@# Build failures on macOS due to gosigar package.
@#github.com/elastic/gosigar
@#../../ra_common/go_home/go1.23.5/pkg/mod/github.com/elastic/gosigar@v0.14.2/concrete_sigar.go:20:12: cpuUsage.Get undefined (type Cpu has no field or method Get)
@#GOOS=darwin GOARCH=amd64 $(GOBUILD) -o bin/tiflash-ctl-darwin-amd64
@#GOOS=darwin GOARCH=arm64 $(GOBUILD) -o bin/tiflash-ctl-darwin-arm64

xz_release: release_all
@echo "Creating xz compressed files..."
@mkdir -p bin/xz
tar cJf bin/xz/tiflash-ctl-linux-amd64.tar.xz -C bin tiflash-ctl-linux-amd64
tar cJf bin/xz/tiflash-ctl-linux-arm64.tar.xz -C bin tiflash-ctl-linux-arm64
@# Uncomment the following lines if macOS builds are enabled.
@# tar cJf bin/xz/tiflash-ctl-darwin-amd64.tar.xz -C bin tiflash-ctl-darwin-amd64
@# tar cJf bin/xz/tiflash-ctl-darwin-arm64.tar.xz -C bin tiflash-ctl-darwin-arm64

test:
$(GOTEST) -timeout 30s ./...
Loading