Test, Build and Release #54
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: Test, Build and Release | |
run-name: Test, Build and Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test-job: | |
name: Test all components | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version-file: 'go.mod' | |
- run: rabo-ci/runTests.sh | |
build-job: | |
name: Build cf-mgmt and cf-mgmt-config tools | |
runs-on: ubuntu-latest | |
needs: test-job | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Go version | |
uses: actions/setup-go@v3 | |
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 cf-mgmt tool | |
env: | |
COMMIT: ${{ github.sha }} | |
run: rabo-ci/build.sh | |
- name: upload cf-mgmt | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist/ | |
release_job: | |
name: Release cf-mgmt and cf-mgmt-config tools | |
runs-on: ubuntu-latest | |
needs: build-job | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- 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@v3 | |
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 }} | |