Skip to content

Commit

Permalink
Use gh tool to upload artifacts (#27)
Browse files Browse the repository at this point in the history
* Use gh tool to upload artifacts

Signed-off-by: galal-hussein <[email protected]>

* use GITHUB_ACTION_TAG env

Signed-off-by: galal-hussein <[email protected]>

---------

Signed-off-by: galal-hussein <[email protected]>
  • Loading branch information
galal-hussein authored Jun 21, 2024
1 parent 13a8b9c commit 08b66f5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ on:
tags:
- "v*"

env:
GH_TOKEN: ${{ github.token }}
GITHUB_ACTION_TAG: ${{ github.ref_name }}

name: Release
permissions:
contents: write
Expand All @@ -21,10 +25,6 @@ jobs:
CROSS: "true"

- name: release binaries
uses: softprops/action-gh-release@v2
with:
files: |
dist/artifacts/*
run: |
gh release upload ${{ github.ref_name }} dist/artifacts/*
21 changes: 11 additions & 10 deletions scripts/version.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/bash

if [ -n "$DRONE_TAG" ]; then
VERSION="$DRONE_TAG"
else
git fetch --tags &>/dev/null || true
GIT_TAG=$(git describe --tags --dirty 2>/dev/null)
if [ -n "$GIT_TAG" ]; then
VERSION="$GIT_TAG"
else
VERSION="v0.0.0-$(git describe --always --dirty)"
fi
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
DIRTY="-dirty"
fi

COMMIT=$(git rev-parse --short HEAD)
GIT_TAG=${GITHUB_ACTION_TAG:-$(git tag -l --contains HEAD | head -n 1)}

if [[ -z "$DIRTY" && -n "$GIT_TAG" ]]; then
VERSION=$GIT_TAG
else
VERSION="${COMMIT}${DIRTY}"
fi

if [ -z "$ARCH" ]; then
Expand Down

0 comments on commit 08b66f5

Please sign in to comment.