From 37f21753aea0eb9abf9bd51b2cfc8b7cbfb43181 Mon Sep 17 00:00:00 2001 From: carlfriedrich Date: Thu, 24 Nov 2022 14:54:00 +0100 Subject: [PATCH 1/6] Meta: change line-endings from CRLF to LF --- .github/workflows/tag.yaml | 40 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml index 6a5ba1b..f8ab7c2 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/tag.yaml @@ -1,20 +1,20 @@ -name: Tag - -on: - schedule: - # Run on every first day of the month - - cron: '0 0 1 * *' - -jobs: - - tag: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Create Tag - run: .github/scripts/tag.sh +name: Tag + +on: + schedule: + # Run on every first day of the month + - cron: '0 0 1 * *' + +jobs: + + tag: + runs-on: ubuntu-latest + steps: + + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Create Tag + run: .github/scripts/tag.sh From f3d9d627768156eaa045126dc256fb6c921bbe2b Mon Sep 17 00:00:00 2001 From: carlfriedrich Date: Thu, 24 Nov 2022 14:55:49 +0100 Subject: [PATCH 2/6] Meta: GitHub tag action: pass GitLab URL as an env variable GitHub action variables are not available in called shell scripts. They have to be explicitly passed from the YAML file. See: https://github.com/orgs/community/discussions/27027 --- .github/scripts/tag.sh | 2 +- .github/workflows/tag.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/scripts/tag.sh b/.github/scripts/tag.sh index 54ffdbc..7b9f8f2 100755 --- a/.github/scripts/tag.sh +++ b/.github/scripts/tag.sh @@ -14,5 +14,5 @@ else git tag -a ${version} -m "Release ${version}" git push origin ${version} echo "Pushed new tag:" - echo "${{github.server_url}}/${{github.repository}}/tag/${version}" + echo "${REPO_URL}/releases/tag/${version}" fi diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml index f8ab7c2..bb71e1e 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/tag.yaml @@ -18,3 +18,5 @@ jobs: - name: Create Tag run: .github/scripts/tag.sh + env: + REPO_URL: ${{github.server_url}}/${{github.repository}} From fb0b22890d5528b688777856f5650f17cf7d6326 Mon Sep 17 00:00:00 2001 From: carlfriedrich Date: Thu, 24 Nov 2022 14:59:06 +0100 Subject: [PATCH 3/6] Meta: GitHub tag action: fix getting of HEAD tag --- .github/scripts/tag.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/tag.sh b/.github/scripts/tag.sh index 7b9f8f2..1534d63 100755 --- a/.github/scripts/tag.sh +++ b/.github/scripts/tag.sh @@ -2,7 +2,7 @@ set -e -head_tag=$(git describe --exact-match 2>/dev/null | true) +head_tag=$(git describe --exact-match 2>/dev/null || true) if [[ ${head_tag} =~ [\d{2}.\d{2}.\d+] ]] then From 8e292f710bc23cabbd7a8ea06fb33f64f6f8bd76 Mon Sep 17 00:00:00 2001 From: carlfriedrich Date: Thu, 24 Nov 2022 15:00:12 +0100 Subject: [PATCH 4/6] Meta: GitHub tag action: improve regex for version matching --- .github/scripts/tag.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/tag.sh b/.github/scripts/tag.sh index 1534d63..e6c66eb 100755 --- a/.github/scripts/tag.sh +++ b/.github/scripts/tag.sh @@ -4,7 +4,7 @@ set -e head_tag=$(git describe --exact-match 2>/dev/null || true) -if [[ ${head_tag} =~ [\d{2}.\d{2}.\d+] ]] +if [[ ${head_tag} =~ [\d{2}\.\d{2}\.\d+] ]] then echo "Current master already has version tag ${head_tag}" else From e6e3ba4ce53ec786c44f32546833e9e143165f12 Mon Sep 17 00:00:00 2001 From: carlfriedrich Date: Thu, 24 Nov 2022 15:00:59 +0100 Subject: [PATCH 5/6] Meta: GitHub tag action: add git log to output for debugging purposes --- .github/scripts/tag.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/scripts/tag.sh b/.github/scripts/tag.sh index e6c66eb..e3e1c7c 100755 --- a/.github/scripts/tag.sh +++ b/.github/scripts/tag.sh @@ -4,6 +4,8 @@ set -e head_tag=$(git describe --exact-match 2>/dev/null || true) +git log --color=always --format="%C(auto)%h %s%d" | head + if [[ ${head_tag} =~ [\d{2}\.\d{2}\.\d+] ]] then echo "Current master already has version tag ${head_tag}" @@ -13,6 +15,7 @@ else version=$(date +'%y.%m.0') git tag -a ${version} -m "Release ${version}" git push origin ${version} + git log --color=always --format="%C(auto)%h %s%d" | head -1 echo "Pushed new tag:" echo "${REPO_URL}/releases/tag/${version}" fi From 402de02eea5f9d49847491545f83b51d866638cf Mon Sep 17 00:00:00 2001 From: carlfriedrich Date: Thu, 24 Nov 2022 15:08:30 +0100 Subject: [PATCH 6/6] Meta: GitHub release: update to checkout@v3 checkout@v2 uses deprecated Node.js 12. See: https://discourse.julialang.org/t/node-js-12-actions-deprecation-warning-on-github/88718 --- .github/workflows/release.yaml | 2 +- .github/workflows/tag.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4c773ca..33f0a6b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml index bb71e1e..5def115 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/tag.yaml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0