Skip to content

Commit 98321ef

Browse files
Merge pull request #247 from carlfriedrich/improve-release-actions
Improve release actions
2 parents a1d1d99 + 402de02 commit 98321ef

File tree

3 files changed

+29
-24
lines changed

3 files changed

+29
-24
lines changed

.github/scripts/tag.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
set -e
44

5-
head_tag=$(git describe --exact-match 2>/dev/null | true)
5+
head_tag=$(git describe --exact-match 2>/dev/null || true)
66

7-
if [[ ${head_tag} =~ [\d{2}.\d{2}.\d+] ]]
7+
git log --color=always --format="%C(auto)%h %s%d" | head
8+
9+
if [[ ${head_tag} =~ [\d{2}\.\d{2}\.\d+] ]]
810
then
911
echo "Current master already has version tag ${head_tag}"
1012
else
@@ -13,6 +15,7 @@ else
1315
version=$(date +'%y.%m.0')
1416
git tag -a ${version} -m "Release ${version}"
1517
git push origin ${version}
18+
git log --color=always --format="%C(auto)%h %s%d" | head -1
1619
echo "Pushed new tag:"
17-
echo "${{github.server_url}}/${{github.repository}}/tag/${version}"
20+
echo "${REPO_URL}/releases/tag/${version}"
1821
fi

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
steps:
1313

1414
- name: Checkout
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
1616
with:
1717
fetch-depth: 0
1818

.github/workflows/tag.yaml

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
name: Tag
2-
3-
on:
4-
schedule:
5-
# Run on every first day of the month
6-
- cron: '0 0 1 * *'
7-
8-
jobs:
9-
10-
tag:
11-
runs-on: ubuntu-latest
12-
steps:
13-
14-
- name: Checkout
15-
uses: actions/checkout@v2
16-
with:
17-
fetch-depth: 0
18-
19-
- name: Create Tag
20-
run: .github/scripts/tag.sh
1+
name: Tag
2+
3+
on:
4+
schedule:
5+
# Run on every first day of the month
6+
- cron: '0 0 1 * *'
7+
8+
jobs:
9+
10+
tag:
11+
runs-on: ubuntu-latest
12+
steps:
13+
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Create Tag
20+
run: .github/scripts/tag.sh
21+
env:
22+
REPO_URL: ${{github.server_url}}/${{github.repository}}

0 commit comments

Comments
 (0)