DEVOPS-3471 go version and dependencies updated (#145) #434
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: CI | |
on: | |
push: | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-20.04 | |
env: | |
TOKEN: ${{ secrets.USER_GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Setup gitconfig fot private go module | |
run: | | |
git config --global url."https://${TOKEN}:x-oauth-basic@github.com/Ridecell".insteadOf "https://github.com/Ridecell" | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v4 | |
with: | |
args: --timeout 5m | |
skip-cache: true | |
build: | |
name: Build | |
runs-on: ubuntu-20.04 | |
needs: lint | |
env: | |
TOKEN: ${{ secrets.USER_GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: build | |
run: | | |
make build_macos build_linux | |
- name: Release | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
mv bin/ridectl.macos bin/ridectl && zip -jrm bin/ridectl_macos.zip bin/ridectl | |
mv bin/ridectl.linux bin/ridectl && zip -jrm bin/ridectl_linux.zip bin/ridectl | |
go install github.com/tcnksm/ghr@latest | |
ghr -c ${{ github.sha }} ${{ github.ref_name }} bin/ |