Skip to content

Make API port and host configurable. #11

Make API port and host configurable.

Make API port and host configurable. #11

Workflow file for this run

name: Make a release
on:
push:
tags:
- v*.*.*
jobs:
test_and_build:
strategy:
matrix:
go-version: [1.16.x]
arch: [linux_amd64, windows_amd64, darwin_amd64, darwin_arm64]
runs-on: ubuntu-latest
env:
GOPATH: /tmp/go
GOARCH:
steps:
- name: create Go path
run: |
mkdir -p /tmp/go
- name: install Golang
uses: actions/setup-go@v2
with:
go-version: ${{matrix.go-version}}
- name: Checkout repository
uses: actions/checkout@v2
- name: Extract version
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: run tests
if: ${{ matrix.arch == 'linux_amd64' }} # we only run the tests on Linux
run: |
export GOARCH=`echo ${{matrix.arch}} | sed 's/[a-z0-9]*_//g'`
export GOOS=`echo ${{matrix.arch}} | sed 's/\([a-z0-9]*\)_[a-z0-9]*$/\1/g'`
make plugins # we build the plugins first
make test
- name: build binaries
run: |
export GOARCH=`echo ${{matrix.arch}} | sed 's/[a-z0-9]*_//g'`
export GOOS=`echo ${{matrix.arch}} | sed 's/\([a-z0-9]*\)_[a-z0-9]*$/\1/g'`
make
- name: Upload binaries (Linux)
if: ${{ matrix.arch == 'linux_amd64' }}
uses: actions/upload-artifact@v2
with:
name: kodex-${{matrix.arch}}
path: |
/tmp/go/bin/*
- name: Upload binaries (all other)
if: ${{ matrix.arch != 'linux_amd64' }}
uses: actions/upload-artifact@v2
with:
name: kodex-${{matrix.arch}}
path: |
/tmp/go/bin/${{matrix.arch}}/*
- name: rename binaries for non-Linux platforms
if: ${{ matrix.arch != 'linux_amd64' && matrix.arch != 'windows_amd64' }}
run: |
mv /tmp/go/bin/${{matrix.arch}}/kodex /tmp/go/bin/${{matrix.arch}}/kodex-${{matrix.arch}}
- name: rename binaries for non-Linux platforms
if: ${{ matrix.arch == 'windows_amd64' }}
run: |
mv /tmp/go/bin/${{matrix.arch}}/kodex.exe /tmp/go/bin/${{matrix.arch}}/kodex-${{matrix.arch}}.exe
- name: Upload binaries to release page
uses: softprops/action-gh-release@v1
with:
files: |
/tmp/go/bin/*/*
/tmp/go/bin/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}