Move get version logic to composite action

This commit is contained in:
Nick Bolton
2024-09-04 17:43:20 +01:00
parent ea90deba96
commit bcb6ee28bf
2 changed files with 19 additions and 1 deletions

10
.github/actions/get-version/action.yml vendored Normal file
View File

@ -0,0 +1,10 @@
name: "Get version"
description: "Gets the version number from GitHub environment"
runs:
using: "composite"
steps:
- if: github.ref_name != "master"
run: echo "SYNERGY_VERSION=${{ github.event.inputs.version || github.ref_name }}" >> $GITHUB_ENV
shell: bash

View File

@ -25,7 +25,6 @@ on:
env:
GIT_SHA: ${{ github.sha }}
SYNERGY_VERSION: ${{ github.event.inputs.version || github.ref_name }}
SYNERGY_PRODUCT_NAME: ${{ vars.SYNERGY_PRODUCT_NAME }}
SYNERGY_PACKAGE_PREFIX: ${{ vars.SYNERGY_PACKAGE_PREFIX }}
SYNERGY_LICENSED_PRODUCT: ${{ vars.SYNERGY_LICENSED_PRODUCT }}
@ -68,6 +67,9 @@ jobs:
with:
submodules: "recursive"
- name: Get version
uses: ./.github/actions/get-version
- name: Cache vcpkg dirs
uses: actions/cache@v4
with:
@ -166,6 +168,9 @@ jobs:
with:
submodules: "recursive"
- name: Get version
uses: ./.github/actions/get-version
- name: Cache deps dir
uses: actions/cache@v4
with:
@ -286,6 +291,9 @@ jobs:
with:
submodules: "recursive"
- name: Get version
uses: ./.github/actions/get-version
- name: Config Git safe dir
run: git config --global --add safe.directory $GITHUB_WORKSPACE