Skip to content

Commit

Permalink
Fix binary release action. (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 authored Aug 18, 2022
1 parent d38fdcd commit 9b96e71
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,14 @@ jobs:

- name: Make tag
run: |
[ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "TAG_NAME=${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV || true
[ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "TAG_NAME=$(echo $GITHUB_REF | awk -F / '{print $3}')-${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV || true
[ "${GITHUB_EVENT_NAME}" == 'release' ] && echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV || true
[ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "TAG_NAME=latest" >> $GITHUB_ENV || true
[ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "TARGET_BINARY_LOCATION=pull-requests/$(echo $GITHUB_REF | awk -F / '{print $3}')-${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV || true
[ "${GITHUB_EVENT_NAME}" == 'release' ] && echo "TARGET_BINARY_LOCATION=${GITHUB_REF##*/}" >> $GITHUB_ENV || true
[ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "TARGET_BINARY_LOCATION=latest" >> $GITHUB_ENV || true
- name: Build
uses: fi-ts/action-docker-make@master
with:
Expand All @@ -69,9 +73,17 @@ jobs:
- name: Prepare upload
run: |
mkdir -p metalctl
mkdir -p metalctl/${TARGET_BINARY_LOCATION}
sudo chown -R $(id -u):$(id -g) result
mv result/* metalctl
mv result/* metalctl/${TARGET_BINARY_LOCATION}/
- name: Upload image tarballs to GCS
run: gsutil -m cp -r -p metalctl gs://$GCS_BUCKET

- name: Upload Release Asset
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: |
result/metalctl-*
if: ${{ github.event_name == 'release' }}

0 comments on commit 9b96e71

Please sign in to comment.