forked from ckan/ckan
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (26 loc) · 927 Bytes
/
github-release.yml
File metadata and controls
33 lines (26 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Create GitHub release
# Create a GitHub release when a tag is pushed
on:
push:
tags:
- 'ckan-**'
jobs:
build:
name: Create GitHub release
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Changelog URL and create release
run: |
TAG_NAME=${{ github.ref_name }}
CKAN_VERSION=$(echo $TAG_NAME | sed -s 's/ckan-//')
MAJOR=$(echo $CKAN_VERSION | cut -d'.' -f1)
MINOR=$(echo $CKAN_VERSION | cut -d'.' -f2)
PATCH=$(echo $CKAN_VERSION | cut -d'.' -f3)
DATE=$(git log -1 --format=%ad --date=format:'%Y-%m-%d' $TAG_NAME)
URL="https://docs.ckan.org/en/$MAJOR.$MINOR/changelog.html#v-$MAJOR-$MINOR-$PATCH-$DATE"
NOTES="Full changelog here: $URL"
gh release create "$TAG_NAME" --verify-tag --title "$TAG_NAME" --notes "$NOTES"