Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use gh tool to upload artifacts #27

Merged
merged 2 commits into from
Jun 21, 2024
Merged
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
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