Trigger CI builds on pull requests

... but upload only tags or pyshes to develop branch

Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
This commit is contained in:
Vasyl Gello 2024-08-06 16:07:36 +03:00
parent bfc106637a
commit 58b3efd2da

View file

@ -1,6 +1,9 @@
name: Trunk / release build name: Trunk / release build
on: on:
pull_request:
paths-ignore:
- "README.md"
push: push:
branches: branches:
- develop - develop
@ -38,11 +41,11 @@ jobs:
run: | run: |
if [ "${{ github.ref_type }}" = "tag" ]; then if [ "${{ github.ref_type }}" = "tag" ]; then
echo "RELEASENAME=${{ github.ref_name }}" >> "$GITHUB_ENV" echo "RELEASENAME=${{ github.ref_name }}" >> "$GITHUB_ENV"
elif [ "${{ github.ref }}" = "refs/heads/develop" ]; then elif [ "${{ github.event_name }}" = "push" ] && [ "${{ github.ref }}" = "refs/heads/develop" ]; then
echo "PRERELEASE=--prerelease" >> "$GITHUB_ENV" echo "PRERELEASE=--prerelease" >> "$GITHUB_ENV"
echo "RELEASENAME=trunk" >> "$GITHUB_ENV" echo "RELEASENAME=trunk" >> "$GITHUB_ENV"
else else
echo "Not a tag or develop branch, skipping upload" echo "Not a tag or push to develop branch, skipping upload"
echo "SKIP_UPLOAD=1" >> "$GITHUB_ENV" echo "SKIP_UPLOAD=1" >> "$GITHUB_ENV"
fi fi