improve install.sh and release ci #1633
Workflow file for this run
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
name: install | |
on: | |
pull_request: | |
branches: | |
- master | |
- release-* | |
paths: | |
- 'install.sh' | |
push: | |
branches: | |
- release-* | |
paths: | |
- 'install.sh' | |
jobs: | |
install: | |
name: Install | |
runs-on: ubuntu-20.04 | |
env: | |
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }} | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
path: go/src/github.com/${{ github.repository }} | |
- name: Install And Check | |
working-directory: ${{ env.working-directory }} | |
run: | | |
sh install.sh | |
source ~/.profile | |
which tiup || (echo "no tiup found" && exit 1) | |
! tiup update --self | grep -i "WARN: adding root certificate" | |
tiup --version | |
local_install: | |
name: Local Install | |
runs-on: ubuntu-latest | |
env: | |
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }} | |
steps: | |
- name: Set up Go 1.21 | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.x | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
path: go/src/github.com/${{ github.repository }} | |
- name: Build TiUP | |
working-directory: ${{ env.working-directory }} | |
run: make tiup | |
- name: Setup TiUP | |
run: | | |
mkdir -p ~/.tiup/bin | |
curl https://tiup-mirrors.pingcap.com/root.json -o ~/.tiup/bin/root.json | |
- name: Clone Mirror | |
working-directory: ${{ env.working-directory }} | |
run: ./bin/tiup mirror clone test-mirror | |
- name: Local Install And Check | |
working-directory: ${{ env.working-directory }}/test-mirror | |
run: | | |
sh local_install.sh | |
source ~/.profile | |
which tiup || (echo "no tiup found" && exit 1) | |
tiup --version | |
cp ../bin/tiup $(which tiup) | |
! tiup list | grep -i "WARN: adding root certificate" | |
tiup --version |