Browse Source

Attempt to fix github tags in each job

See https://github.com/actions/checkout/issues/290 for some discussion.
pull/883/head
Hamish Coleman 3 years ago
parent
commit
5b5fe587ae
  1. 59
      .github/workflows/tests.yml

59
.github/workflows/tests.yml

@ -251,6 +251,10 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Fix Checkout
run: |
git fetch --force --tags
- name: Install packages needed for build - name: Install packages needed for build
run: | run: |
sudo apt-get update sudo apt-get update
@ -293,6 +297,10 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Fix Checkout
run: |
git fetch --force --tags
- name: Install packages needed for build - name: Install packages needed for build
run: | run: |
sudo apt-get install rpm sudo apt-get install rpm
@ -328,6 +336,10 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Fix Checkout
run: |
git fetch --force --tags
- name: Configure and Build - name: Configure and Build
shell: bash shell: bash
run: | run: |
@ -360,6 +372,10 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Fix Checkout
run: |
git fetch --force --tags
- name: Install packages needed for build - name: Install packages needed for build
run: | run: |
brew install automake brew install automake
@ -403,6 +419,10 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Fix Checkout
run: |
git fetch --force --tags
- name: Install packages needed for build - name: Install packages needed for build
run: | run: |
brew install automake brew install automake
@ -452,6 +472,10 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Fix Checkout
run: |
git fetch --force --tags
- name: Install cross compiler - name: Install cross compiler
run: | run: |
sudo apt-get update sudo apt-get update
@ -481,7 +505,14 @@ jobs:
# Given the clearly documented use of annotated tags to signal releases, # Given the clearly documented use of annotated tags to signal releases,
# it seems strange that there is no simple way to trigger actions if the # it seems strange that there is no simple way to trigger actions if the
# tag is annotated. So we need to jump through some hoops. # tag is annotated. So we need to jump through some extra hoops.
#
# Looking at https://github.com/actions/checkout/issues/290 seems to show
# that github just doesnt care about how git expects annotated tags to be
# used.
#
# This workflow has added a `git fetch --force --tags` to every job that
# needs to have working tags
# #
upload_release: upload_release:
name: Upload Release Assets name: Upload Release Assets
@ -496,29 +527,11 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# There is something strange with the repo that you end up with - uses: actions/checkout@v2
# using actions/checkout@v2.
# - name: Fix Checkout
# It appears that the repository that is checked out as part of a tag
# action does not have the correct tag object in it. As a work around,
# we dont use the actions/checkout@v2
#
# Normally, `git for-each-ref refs/tags` will show annotated tags
# with a type of "tag" and lightweight with type "commit".
# But not with the actions/checkout@v2 checkout
#
# Additionally, it seems that if you push both a commit and an annotated
# tag at the same time, two workflow actions start (as expected), and
# the two checkouts show different things:
# - the annodated tag is visible in the "commit" action
# - but it looks like a lightweight tag in the "tag" action
#
# See https://github.com/actions/checkout/issues/290 for a whole lot of
# 'no comment' from github
#
- name: Checkout
run: | run: |
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY . git fetch --force --tags
- name: Get Tag Type - name: Get Tag Type
run: | run: |

Loading…
Cancel
Save