Skip to content

Commit

Permalink
feat: sepate tag/master builds
Browse files Browse the repository at this point in the history
  • Loading branch information
vrince committed Apr 26, 2024
1 parent afa1902 commit 1fc72ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/beats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set tag
run: echo "git_tag=:${GITHUB_REF#refs/*/}" >> $GITHUB_STATE
- name: Build beat (tag)
id: build-beat
if: "startsWith(github.ref, 'refs/tags/')"
run: ./build.sh ${{ matrix.beat }} ${{ matrix.arch }}

- name: Build beat
- name: Build beat (master)
id: build-beat
run: ./build.sh ${{ matrix.beat }} ${{ matrix.arch }} $git_tag
if: "!startsWith(github.ref, 'refs/tags/')"
run: ./build.sh ${{ matrix.beat }} ${{ matrix.arch }} master

- uses: actions/upload-artifact@v2
if: startsWith(github.ref, 'refs/tags/')
Expand Down
9 changes: 6 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
#set -e
BEAT="${1:-filebeat}"
ARCH="${2:-armv7l}"
BRANCH="${3}"
REF_NAME="${3}"

TAG=$(git describe --tags --exact-match 2> /dev/null)
if [[ -n ${GITHUB_REF_NAME} ]] ; then
BRANCH=${GITHUB_REF_NAME}
echo "Using GITHUB_REF_NAME(${BRANCH})"
fi

if [[ -z ${TAG} ]] ; then
if [[ -z ${BRANCH} ]] ; then
BRANCH="master"
echo "Using default branch(${BRANCH})"
fi
Expand Down

0 comments on commit 1fc72ef

Please sign in to comment.