Skip to content

Upgrade to latest openapi schema #339

Upgrade to latest openapi schema

Upgrade to latest openapi schema #339

Workflow file for this run

name: Build
on: [push]
# We need this so we can tag our repo if the build succeeds and the version
# doesn't match.
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
outputs:
release: '${{ steps.tag.outputs.release }}'
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
-
name: Build
run: go run cmd/catalog-importer/main.go --help
-
name: Install ginkgo
run: go install github.com/onsi/ginkgo/v2/ginkgo
-
name: Run tests
run: ginkgo -r .
-
id: tag
name: Tag if new version
if: github.ref == 'refs/heads/master'
run: |
CURRENT_VERSION="v$(cat cmd/catalog-importer/cmd/VERSION)"
if [[ $(git tag -l "${CURRENT_VERSION}") == "${CURRENT_VERSION}" ]]; then
echo "Version ${CURRENT_VERSION} is already released"
exit 0
fi
git tag "${CURRENT_VERSION}"
git push --tags
-
name: Login to Docker Hub
if: github.ref == 'refs/heads/master'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_PUBLISHER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PUBLISHER_KEY }}
-
name: Run GoReleaser
if: github.ref == 'refs/heads/master'
continue-on-error: true
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}