-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (67 loc) · 1.96 KB
/
Copy pathautotag.yml
File metadata and controls
76 lines (67 loc) · 1.96 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: autotag
on:
push:
branches:
- main
jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Bump version and push tag
id: tag
uses: anothrNick/github-tag-action@v1
env:
WITH_V: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: none
RELEASE_BRANCHES: main
outputs:
bump: ${{ steps.tag.outputs.part }}
new_tag: ${{ steps.tag.outputs.new_tag }}
build_release:
runs-on: ubuntu-latest
needs: tag
if: needs.tag.outputs.bump != 'none'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Process changelog
run: |
if [[ ! -z $(cat changelog/next.md) ]] ; then
mv changelog/next.md changelog/${{ needs.tag.outputs.new_tag }}.md
touch changelog/next.md
fi
- name: Commit changes
continue-on-error: true
run: |
git config --global user.email "noreply@dsmdesign.co.uk"
git config --global user.name "AdminUI Action"
git add .
git commit -m "Github Action compiled resources"
git push
- name: Set changelog path
id: changelog_path
run: |
if [-e changelog/${TAG}.md]
then
echo "changelog=${ TAG }" >> $GITHUB_OUTPUT
else
echo "changelog=next" >> $GITHUB_OUTPUT
fi
env:
TAG: ${{ needs.tag.outputs.new_tag }}
- name: Create Github release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.tag.outputs.new_tag }}
name: Release ${{ needs.tag.outputs.new_tag }}
body_path: changelog/${{ steps.changelog_path.outputs.changelog }}.md
draft: false
prerelease: false