Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya committed Oct 26, 2020
1 parent a8b29ca commit b8d9d0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
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 ${{ env.BINARY_NAME }}-${{ env.VERSION }}-linux-amd64.tgz build/${{ env.BINARY_NAME }}
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
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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"

0 comments on commit b8d9d0c

Please sign in to comment.