Skip to content

Commit

Permalink
build: workaround for an actions/checkout bug
Browse files Browse the repository at this point in the history
a9a6e9e and ea43df2 removed a step that was probably intended to
work around actions/checkout#290 and
actions/checkout#882, but broke the CI build
if anyone used a lightweight tag (because these fetch lines actually
shallow the tag depth to 1). This commit attempts to thread the needle
by making this workaround conditional only to releases, where (if the
person doing the release has followed the steps correctly), there is
guaranteed to be an annotated tag at depth 1 in the tag history. (If I'm
parsing the checkout bugs correctly, they only trigger on a tag action
anyways.)
  • Loading branch information
rawlins committed Jun 1, 2023
1 parent aae7365 commit 2797cd8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
runs-on: ubuntu-latest
if: github.event.release.tag_name != null
steps:
- name: Fix tags for release # work around https://github.com/actions/checkout/issues/882
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* # will break on a lightweight tag
- uses: actions/checkout@v3
with:
fetch-depth: 0 # all history
Expand Down Expand Up @@ -115,6 +117,9 @@ jobs:
with:
fetch-depth: 0 # all history
submodules: true
- name: Fix tags for release # work around https://github.com/actions/checkout/issues/882
if: github.event.release.tag_name != null
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* # will break on a lightweight tag
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -182,6 +187,8 @@ jobs:
- build_type: tiles
build_opts: LINUXDEPLOY=/tmp/linuxdeploy-x86_64.AppImage
steps:
- name: Fix tags for release # work around https://github.com/actions/checkout/issues/882
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* # will break on a lightweight tag
- uses: actions/checkout@v3
with:
fetch-depth: 0 # all history
Expand Down Expand Up @@ -222,6 +229,8 @@ jobs:
with:
fetch-depth: 0 # all history
submodules: false
- name: Fix tags for release # work around https://github.com/actions/checkout/issues/882
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* # will break on a lightweight tag
- name: Install dependencies
run: ./deps.py --build-opts TILES=1 --debian-packages
working-directory: .github/workflows
Expand Down Expand Up @@ -292,6 +301,9 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # all history
- name: Fix tags for release # work around https://github.com/actions/checkout/issues/882
if: github.event.release.tag_name != null
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* # will break on a lightweight tag
- name: Checkout submodules
shell: bash
run: |
Expand Down Expand Up @@ -338,6 +350,9 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # all history
- name: Fix tags for release # work around https://github.com/actions/checkout/issues/882
if: github.event.release.tag_name != null
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* # will break on a lightweight tag
- name: Checkout submodules (for crosscompile)
shell: bash
run: |
Expand Down Expand Up @@ -537,6 +552,9 @@ jobs:
with:
fetch-depth: 0 # all history
submodules: true
- name: Fix tags for release # work around https://github.com/actions/checkout/issues/882
if: github.event.release.tag_name != null
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* # will break on a lightweight tag
- name: Install dependencies
run: ./deps.py --build-opts "${{ matrix.build_opts }}"
working-directory: .github/workflows
Expand Down

0 comments on commit 2797cd8

Please sign in to comment.