mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-04-15 07:16:34 +00:00
99 lines
2.4 KiB
YAML
99 lines
2.4 KiB
YAML
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
push:
|
|
branches:
|
|
- "master"
|
|
tags:
|
|
- "v*.*.*"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-18.04
|
|
steps:
|
|
- uses: actions/setup-go@v1
|
|
with:
|
|
go-version: "1.14"
|
|
|
|
- name: setup env
|
|
run: |
|
|
echo "::set-env name=GOPATH::$(go env GOPATH)"
|
|
echo "::add-path::$(go env GOPATH)/bin"
|
|
shell: bash
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- run: make
|
|
|
|
compile-preflight:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- uses: actions/setup-go@v1
|
|
with:
|
|
go-version: '1.14'
|
|
- name: setup env
|
|
run: |
|
|
echo "::set-env name=GOPATH::$(go env GOPATH)"
|
|
echo "::add-path::$(go env GOPATH)/bin"
|
|
shell: bash
|
|
- uses: actions/checkout@master
|
|
- run: make preflight
|
|
- uses: actions/upload-artifact@v1
|
|
with:
|
|
name: preflight
|
|
path: bin/preflight
|
|
|
|
validate-preflight:
|
|
runs-on: ubuntu-latest
|
|
needs: compile-preflight
|
|
steps:
|
|
- name: Download preflight binary
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: preflight
|
|
path: bin/
|
|
- uses: engineerd/setup-kind@v0.2.0
|
|
- run: chmod +x bin/preflight
|
|
- run: bin/preflight --interactive=false --format=json https://preflight.replicated.com
|
|
|
|
goreleaser:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- validate-preflight
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- uses: azure/docker-login@v1
|
|
with:
|
|
username: repldeploy2
|
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
|
|
- name: Unshallow
|
|
run: git fetch --prune --unshallow
|
|
|
|
- uses: actions/setup-go@v1
|
|
with:
|
|
go-version: "1.14"
|
|
|
|
- name: Run GoReleaser
|
|
uses: goreleaser/goreleaser-action@v2
|
|
with:
|
|
version: latest
|
|
args: release --rm-dist --config deploy/.goreleaser.yaml
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
- name: Update new preflight version in krew-index
|
|
uses: rajatjindal/krew-release-bot@v0.0.38
|
|
with:
|
|
krew_template_file: deploy/krew/preflight.yaml
|
|
- name: Update new support-bundle version in krew-index
|
|
uses: rajatjindal/krew-release-bot@v0.0.38
|
|
with:
|
|
krew_template_file: deploy/krew/support-bundle.yaml
|