Skip to content

Build and Release

Build and Release #9

name: Build and Release
run-name: Build and Release
on:
push:
branches:
- main
jobs:
build-job:
name: Build credhub-service-broker
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Go version
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Install versioning tool
run: go install github.com/xchapter7x/versioning@latest
- name: Determine Version
id: determine_version
run: |
echo VERSION=$(~/go/bin/versioning bump_patch) >> ${GITHUB_ENV}
- name: Build credhub-service-broker
env:
COMMIT: ${{ github.sha }}
run: .github/scripts/build.sh
- name: upload credhub-service-broker
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
release_job:
name: Release credhub-service-broker
runs-on: ubuntu-latest
needs: build-job
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install versioning tool
run: go install github.com/xchapter7x/versioning@latest
- name: Determine Version
id: determine_version
run: |
echo VERSION=$(~/go/bin/versioning bump_patch) >> ${GITHUB_ENV}
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Create Release using gh
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: "Release ${{ env.VERSION }}"
files: dist/*
tag_name: ${{ env.VERSION }}