name: Build and Release on: workflow_dispatch: inputs: version: description: 'Netmaker version' required: false release: types: [published] jobs: build: runs-on: ubuntu-latest steps: - name: Get Version Number run: | if [[ -n "${{ github.event.inputs.version }}" ]]; then NETMAKER_VERSION=${{ github.event.inputs.version }} else NETMAKER_VERSION=$(curl -fsSL https://api.github.com/repos/gravitl/netmaker/tags | grep 'name' | head -1 | cut -d'"' -f4) fi echo "NETMAKER_VERSION=${NETMAKER_VERSION}" >> $GITHUB_ENV # remove leading v for package (deb, rpm, etc) versions echo "PACKAGE_VERSION=${NETMAKER_VERSION:1}" >> $GITHUB_ENV - name: Checkout uses: actions/checkout@v2 - name: Setup go uses: actions/setup-go@v2 with: go-version: 1.17 - name: Build run: | #env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netmaker main.go cd netclient env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-X 'main.version=${NETMAKER_VERSION}'" -o build/netclient main.go <