forked from novateams/nova.core
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (33 loc) · 1.05 KB
/
release.yml
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
34
35
36
37
38
39
40
41
42
43
---
name: Creating new tag & release
on:
push:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
tag_and_release:
runs-on: ubuntu-latest
steps:
- name: Cloning the repository repo...
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Creating a tag and a release
run: |
VERSION_FILE="nova/core/galaxy.yml"
VERSION=$(cat $VERSION_FILE | grep "version:" | cut -d " " -f 2)
CURRENT_TAG=$(git tag --sort=-creatordate | head -n 1)
TAG_NAME="v$VERSION"
echo "LATEST_TAG=$TAG_NAME" >> $GITHUB_ENV
# Tagging and pushing the change
git tag $TAG_NAME
git push origin $TAG_NAME
# Creating temp changelog file
git log $CURRENT_TAG..$TAG_NAME --pretty=format:"- %s" > CHANGELOG.md
- name: Releasing a new version...
uses: ncipollo/release-action@v1
with:
tag: ${{ env.LATEST_TAG }}
bodyFile: CHANGELOG.md