Move get version logic to composite action
This commit is contained in:
parent
ea90deba96
commit
bcb6ee28bf
2 changed files with 19 additions and 1 deletions
10
.github/actions/get-version/action.yml
vendored
Normal file
10
.github/actions/get-version/action.yml
vendored
Normal 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
|
||||||
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
|
|
@ -25,7 +25,6 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GIT_SHA: ${{ github.sha }}
|
GIT_SHA: ${{ github.sha }}
|
||||||
SYNERGY_VERSION: ${{ github.event.inputs.version || github.ref_name }}
|
|
||||||
SYNERGY_PRODUCT_NAME: ${{ vars.SYNERGY_PRODUCT_NAME }}
|
SYNERGY_PRODUCT_NAME: ${{ vars.SYNERGY_PRODUCT_NAME }}
|
||||||
SYNERGY_PACKAGE_PREFIX: ${{ vars.SYNERGY_PACKAGE_PREFIX }}
|
SYNERGY_PACKAGE_PREFIX: ${{ vars.SYNERGY_PACKAGE_PREFIX }}
|
||||||
SYNERGY_LICENSED_PRODUCT: ${{ vars.SYNERGY_LICENSED_PRODUCT }}
|
SYNERGY_LICENSED_PRODUCT: ${{ vars.SYNERGY_LICENSED_PRODUCT }}
|
||||||
|
|
@ -68,6 +67,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: "recursive"
|
submodules: "recursive"
|
||||||
|
|
||||||
|
- name: Get version
|
||||||
|
uses: ./.github/actions/get-version
|
||||||
|
|
||||||
- name: Cache vcpkg dirs
|
- name: Cache vcpkg dirs
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
|
|
@ -166,6 +168,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: "recursive"
|
submodules: "recursive"
|
||||||
|
|
||||||
|
- name: Get version
|
||||||
|
uses: ./.github/actions/get-version
|
||||||
|
|
||||||
- name: Cache deps dir
|
- name: Cache deps dir
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
|
|
@ -286,6 +291,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: "recursive"
|
submodules: "recursive"
|
||||||
|
|
||||||
|
- name: Get version
|
||||||
|
uses: ./.github/actions/get-version
|
||||||
|
|
||||||
- name: Config Git safe dir
|
- name: Config Git safe dir
|
||||||
run: git config --global --add safe.directory $GITHUB_WORKSPACE
|
run: git config --global --add safe.directory $GITHUB_WORKSPACE
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue