-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ilya
committed
Oct 26, 2020
1 parent
a8b29ca
commit b8d9d0c
Showing
2 changed files
with
6 additions
and
13 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,31 +26,24 @@ jobs: | |
|
||
- name: Get Branch | ||
run: | | ||
raw=$(git branch -r --contains ${{ github.ref }}) | ||
branch=${raw/origin\/} | ||
branch=$( echo ${{ github.ref }} | sed 's/^.*\/.*\///g') | ||
echo ::set-env name=VERSION::$branch | ||
- name: Get dependencies | ||
run: | | ||
go get -v -t -d ./... | ||
- name: Build | ||
run: go build -v -i -ldflags "-X my/checker/config.Version=${VERSION} -X my/checker/config.VersionSHA=${GITHUB_SHA} -X my/checker/config.VersionBuild=${GITHUB_RUN_ID}" -o build/${BINARY_NAME} | ||
env: | ||
BINARY_NAME: "checker" | ||
run: go build -v -i -ldflags "-X my/checker/config.Version=${{ env.VERSION }} -X my/checker/config.VersionSHA=${GITHUB_SHA} -X my/checker/config.VersionBuild=${GITHUB_RUN_ID}" -o build/${{ env.BINARY_NAME }} | ||
|
||
- name: Compress binary | ||
run: tar -czvf ${BINARY_NAME}-${VERSION}-linux-amd64.tgz build/${BINARY_NAME} | ||
env: | ||
BINARY_NAME: "checker" | ||
run: tar -czvf ${{ env.BINARY_NAME }}-${{ env.VERSION }}-linux-amd64.tgz -C build ${{ env.BINARY_NAME }} | ||
|
||
- name: Upload a Build Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: checker | ||
path: ${BINARY_NAME}-${VERSION}-linux-amd64.tgz | ||
env: | ||
BINARY_NAME: "checker" | ||
path: ${{ env.BINARY_NAME }}-${{ env.VERSION }}-linux-amd64.tgz | ||
|
||
- name: Build and push Docker images | ||
uses: docker/[email protected] | ||
|
@@ -69,6 +62,6 @@ jobs: | |
asset_name: checker | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
body: "Checker release ${GITHUB_REF}" | ||
body: "Checker release ${{ env.VERSION }}" | ||
env: | ||
BINARY_NAME: "checker" |