Merge pull request #47 from intelops/add-ca-to-agent-cert #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: Build and publish capten CLI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*.*.*' # Only build on tags that match the 'vX.Y.Z' pattern | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.20' | |
- name: Set release tag as env | |
id: release | |
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
- name: Check release tag | |
env: | |
RELEASE_VERSION: ${{ steps.release.outputs.tag }} | |
run: | | |
echo $RELEASE_VERSION | |
echo ${{ steps.release.outputs.tag }} | |
echo ${{ github.ref }} | |
- uses: nowsprinting/check-version-format-action@v3 | |
id: version | |
with: | |
prefix: 'v' | |
- name: Build release | |
if: steps.version.outputs.is_valid == 'true' | |
run: make build.release | |
- name: Create Github release | |
if: steps.version.outputs.is_valid == 'true' | |
id: create-release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.release.outputs.tag }} | |
release_name: ${{ steps.release.outputs.tag }} | |
- name: Upload Artifacts | |
if: steps.version.outputs.is_valid == 'true' | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
asset_path: ./capten.zip | |
asset_name: capten.zip | |
asset_content_type: application |