Merge pull request #158 from Jeremy4040/main #181
Workflow file for this run
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_and_release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.21' | |
- 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: Create Github release | |
if: steps.version.outputs.is_valid == 'true' | |
id: create-release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
with: | |
tag_name: ${{ steps.release.outputs.tag }} | |
release_name: ${{ steps.release.outputs.tag }} | |
- name: Build release | |
if: steps.version.outputs.is_valid == 'true' | |
run: make build.release-linux | |
- name: Upload Artifacts | |
if: steps.version.outputs.is_valid == 'true' | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
asset_path: ./capten.zip | |
asset_name: capten_linux.zip | |
asset_content_type: application | |
- name: Build release for mac | |
if: steps.version.outputs.is_valid == 'true' | |
run: make build.release-mac | |
- name: Upload Artifacts for mac | |
if: steps.version.outputs.is_valid == 'true' | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
asset_path: ./capten.zip | |
asset_name: capten_mac.zip | |
asset_content_type: application |