Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/plugin_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
run: echo "PLUGIN_NAME=$(basename ${{ inputs.path }})" >> $GITHUB_ENV
- name: Build binary artifacts
run: |
make build/plugin PLUGINS=$PLUGIN_NAME BUILD_OS=linux BUILD_ARCH=amd64 BIN_SUFFIX=_${{ inputs.version }}_linux_amd64
make build/plugin PLUGINS=$PLUGIN_NAME BUILD_OS=linux BUILD_ARCH=arm64 BIN_SUFFIX=_${{ inputs.version }}_linux_arm64
make build/plugin PLUGINS=$PLUGIN_NAME BUILD_OS=darwin BUILD_ARCH=amd64 BIN_SUFFIX=_${{ inputs.version }}_darwin_amd64
make build/plugin PLUGINS=$PLUGIN_NAME BUILD_OS=darwin BUILD_ARCH=arm64 BIN_SUFFIX=_${{ inputs.version }}_darwin_arm64
make build/plugin PLUGINS=$PLUGIN_NAME BUILD_OS=linux BUILD_ARCH=amd64 BIN_SUFFIX=_${{ inputs.version }}_linux_amd64 BUILD_VERSION=${{ inputs.version }} BUILD_COMMIT=${{ github.sha }} BUILD_DATE=$(date -u +%Y%m%d-%H%M%S)
make build/plugin PLUGINS=$PLUGIN_NAME BUILD_OS=linux BUILD_ARCH=arm64 BIN_SUFFIX=_${{ inputs.version }}_linux_arm64 BUILD_VERSION=${{ inputs.version }} BUILD_COMMIT=${{ github.sha }} BUILD_DATE=$(date -u +%Y%m%d-%H%M%S)
make build/plugin PLUGINS=$PLUGIN_NAME BUILD_OS=darwin BUILD_ARCH=amd64 BIN_SUFFIX=_${{ inputs.version }}_darwin_amd64 BUILD_VERSION=${{ inputs.version }} BUILD_COMMIT=${{ github.sha }} BUILD_DATE=$(date -u +%Y%m%d-%H%M%S)
make build/plugin PLUGINS=$PLUGIN_NAME BUILD_OS=darwin BUILD_ARCH=arm64 BIN_SUFFIX=_${{ inputs.version }}_darwin_arm64 BUILD_VERSION=${{ inputs.version }} BUILD_COMMIT=${{ github.sha }} BUILD_DATE=$(date -u +%Y%m%d-%H%M%S)
- env:
INPUT_VERSION: ${{ inputs.version }}
INPUT_PATH: ${{ inputs.path }}
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,15 @@ else
endif

.PHONY: build/plugin
build/plugin: BUILD_VERSION ?= $(shell git describe --tags --always --dirty --abbrev=7 --match 'v[0-9]*.*')
build/plugin: BUILD_COMMIT ?= $(shell git rev-parse HEAD)
build/plugin: BUILD_DATE ?= $(shell date -u '+%Y%m%d-%H%M%S')
build/plugin: BUILD_LDFLAGS_PREFIX := -X github.com/pipe-cd/pipecd/pkg/version
build/plugin: PLUGINS_BIN_DIR ?= ~/.piped/plugins
build/plugin: PLUGINS_SRC_DIR ?= ./pkg/app/pipedv1/plugin
build/plugin: PLUGINS_OUT_DIR ?= ${PWD}/.artifacts/plugins
build/plugin: PLUGINS ?= $(shell find $(PLUGINS_SRC_DIR) -mindepth 1 -maxdepth 1 -type d | while read -r dir; do basename "$$dir"; done | paste -sd, -) # comma separated list of plugins. eg: PLUGINS=kubernetes,ecs,lambda
build/plugin: BUILD_OPTS ?= -ldflags "-s -w" -trimpath
build/plugin: BUILD_OPTS ?= -ldflags "$(BUILD_LDFLAGS_PREFIX).version=$(BUILD_VERSION) $(BUILD_LDFLAGS_PREFIX).gitCommit=$(BUILD_COMMIT) $(BUILD_LDFLAGS_PREFIX).buildDate=$(BUILD_DATE) -s -w" -trimpath
build/plugin: BUILD_OS ?= $(shell go version | cut -d ' ' -f4 | cut -d/ -f1)
build/plugin: BUILD_ARCH ?= $(shell go version | cut -d ' ' -f4 | cut -d/ -f2)
build/plugin: BUILD_ENV ?= GOOS=$(BUILD_OS) GOARCH=$(BUILD_ARCH) CGO_ENABLED=0
Expand Down