mirror of
https://github.com/wfxr/forgit.git
synced 2026-09-10 07:16:23 -04:00
Merge pull request #247 from carlfriedrich/improve-release-actions
Improve release actions
This commit is contained in:
commit
98321ef05a
9
.github/scripts/tag.sh
vendored
9
.github/scripts/tag.sh
vendored
|
|
@ -2,9 +2,11 @@
|
|||
|
||||
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+] ]]
|
||||
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}"
|
||||
else
|
||||
|
|
@ -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 "${{github.server_url}}/${{github.repository}}/tag/${version}"
|
||||
echo "${REPO_URL}/releases/tag/${version}"
|
||||
fi
|
||||
|
|
|
|||
2
.github/workflows/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
|
|
@ -12,7 +12,7 @@ jobs:
|
|||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
|
|
|
|||
42
.github/workflows/tag.yaml
vendored
42
.github/workflows/tag.yaml
vendored
|
|
@ -1,20 +1,22 @@
|
|||
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@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Create Tag
|
||||
run: .github/scripts/tag.sh
|
||||
env:
|
||||
REPO_URL: ${{github.server_url}}/${{github.repository}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue