diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml index 2440f8c7..d1b4b920 100644 --- a/.github/workflows/book.yml +++ b/.github/workflows/book.yml @@ -14,7 +14,19 @@ jobs: build-book: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + # Fetch tag manually because fetch-tags option for checkout@v4 does not work + - name: Fetch tag annotations + run: | + # Fetch tag manually because fetch-tags option for checkout@v4 does not work + git fetch --force --tags --depth 1 + - id: read_tag + name: Set VERSION env variable + if: ${{ startsWith(github.ref, 'refs/tags') }} + run: | + # Set tag from GitHub: using git describe for tags inside the run script + # seems not working + echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - uses: actions/cache@v3 with: diff --git a/.github/workflows/distribute_package.yml b/.github/workflows/distribute_package.yml index 7473704c..f2d07564 100644 --- a/.github/workflows/distribute_package.yml +++ b/.github/workflows/distribute_package.yml @@ -61,7 +61,18 @@ jobs: with: # We need quite a deep fetch so that we get the versioning right fetch-depth: 500 - fetch-tags: true + # Fetch tag manually because fetch-tags option for checkout@v4 does not work + - name: Fetch tag annotations + run: | + # Fetch tag manually because fetch-tags option for checkout@v4 does not work + git fetch --force --tags --depth 1 + - id: read_tag + name: Set VERSION env variable + if: ${{ startsWith(github.ref, 'refs/tags') }} + run: | + # Set tag from GitHub: using git describe for tags inside the run script + # seems not working + echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Install dependencies run: | @@ -109,7 +120,18 @@ jobs: with: # We need quite a deep fetch so that we get the versioning right fetch-depth: 500 - fetch-tags: true + # Fetch tag manually because fetch-tags option for checkout@v4 does not work + - name: Fetch tag annotations + run: | + # Fetch tag manually because fetch-tags option for checkout@v4 does not work + git fetch --force --tags --depth 1 + - id: read_tag + name: Set VERSION env variable + if: ${{ startsWith(github.ref, 'refs/tags') }} + run: | + # Set tag from GitHub: using git describe for tags inside the run script + # seems not working + echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV # setuptools_scm workaround for https://github.com/pypa/setuptools_scm/issues/455 - name: Disable local version identifier on develop CI diff --git a/.github/workflows/test_package.yml b/.github/workflows/test_package.yml index 500f8913..317d723d 100644 --- a/.github/workflows/test_package.yml +++ b/.github/workflows/test_package.yml @@ -23,6 +23,18 @@ jobs: steps: - uses: actions/checkout@v4 + # Fetch tag manually because fetch-tags option for checkout@v4 does not work + - name: Fetch tag annotations + run: | + # Fetch tag manually because fetch-tags option for checkout@v4 does not work + git fetch --force --tags --depth 1 + - id: read_tag + name: Set VERSION env variable + if: ${{ startsWith(github.ref, 'refs/tags') }} + run: | + # Set tag from GitHub: using git describe for tags inside the run script + # seems not working + echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - uses: actions/cache@v4 if: startsWith(runner.os, 'Linux')