Skip to content

added colored log output #13

added colored log output

added colored log output #13

Workflow file for this run

name: Create Release
on:
push:
tags:
- 'v*.*.*'
jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: false
prerelease: false
body: |
## Installation Instructions
### Using the Binary
Download the binary for your platform from the releases page and add it to your PATH.
#### Example for Linux
```sh
wget https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/consul-io-linux-amd64
chmod +x consul-io-linux-amd64
sudo mv consul-io-linux-amd64 /usr/local/bin/consul-io
```
#### Example for macOS
```sh
wget https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/consul-io-darwin-amd64
chmod +x consul-io-darwin-amd64
sudo mv consul-io-darwin-amd64 /usr/local/bin/consul-io
```
#### Example for Windows
Download the binary from the releases page and add it to your PATH.
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
build:
needs: create_release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
extension: ""
- os: macos-latest
goos: darwin
goarch: amd64
extension: ""
- os: windows-latest
goos: windows
goarch: amd64
extension: ".exe"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.20'
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: go build -o consul-io-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.extension }}
- name: Upload Linux Binary
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./consul-io-linux-amd64
asset_name: consul-io-linux-amd64
asset_content_type: application/octet-stream
- name: Upload macOS Binary
if: matrix.os == 'macos-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./consul-io-darwin-amd64
asset_name: consul-io-darwin-amd64
asset_content_type: application/octet-stream
- name: Upload Windows Binary
if: matrix.os == 'windows-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./consul-io-windows-amd64.exe
asset_name: consul-io-windows-amd64.exe
asset_content_type: application/octet-stream