fixes #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: 2023-2024 TII (SSRC) and the Ghaf contributors | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
name: test | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- test_versiontag | |
permissions: | |
contents: read | |
jobs: | |
build_target: | |
runs-on: ubuntu-latest | |
timeout-minutes: 360 | |
name: Build FMO-OS | |
steps: | |
# To use this repository's private action, | |
# you must check out the repository | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
fetch-depth: 0 | |
- name: Generate build version | |
shell: bash | |
run: | | |
# Default to version based on GITHUB_SHA | |
buildver="${{ github.sha }}" | |
buildver="git-${buildver:0:7}" | |
if [[ "${{ github.ref_type }}" == "tag" ]]; then | |
buildver="${{ github.ref_name }}" | |
elif [[ "${{ github.ref_type }}" == "branch" ]]; then | |
# Check if there's a reachable tag on the branch | |
if git name-rev --name-only --tags --no-undefined "${{ github.ref }}" 2>/dev/null; then | |
# No reachable parent tag on branch | |
buildver="${{ github.ref_name }}-$(git rev-parse --short "${{ github.ref }}")" | |
else | |
buildver="$(git describe --tags "${{ github.ref }}")" | |
fi | |
fi | |
echo "github.sha: ${{ github.sha }}" | |
echo "github.ref: ${{ github.ref }}" | |
echo "github.ref_type: ${{ github.ref_type }}" | |
echo "github.ref_name: ${{ github.ref_name }}" | |
echo "build_version=$buildver" | |
echo "build_version=$buildver" >> "$GITHUB_OUTPUT" |