Skip to content

Commit e112d73

Browse files
committed
new workflow with versions
1 parent 52f3a25 commit e112d73

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/redguides-publish.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ name: Publish to RedGuides
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
tags:
6+
- 'v*'
7+
- '[0-9]*'
68

79
jobs:
810
publish:
@@ -11,11 +13,19 @@ jobs:
1113
- name: Checkout code
1214
uses: actions/checkout@v4
1315
with:
14-
ref: "${{ github.ref }}"
16+
ref: "${{ github.ref }}"
17+
fetch-depth: 0
1518

1619
- name: Build zip file
1720
run: git archive --format=zip --prefix="${{ github.event.repository.name }}/" -o "${{ github.event.repository.name }}.zip" HEAD
1821

22+
- name: Create message from git log
23+
env:
24+
VERSION: "${{ github.ref_name }}"
25+
run: |
26+
PREV=$(git describe --tags --abbrev=0 "${VERSION}^" 2>/dev/null || echo "")
27+
git log --no-merges --pretty=format:"- [%s](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/%H)%n%n%b%n%n~ %an" ${PREV:+$PREV..}${VERSION} > rg_
28+
1929
- name: Publish to RedGuides
2030
uses: RedGuides/redguides-publish@v1
2131
env:
@@ -24,4 +34,5 @@ jobs:
2434
resource_id: "3012"
2535
version: "${{ github.ref_name }}"
2636
file: "${{ github.event.repository.name }}.zip"
37+
message: "rg_release_notes.md"
2738
domain: "https://raw.githubusercontent.com/${{ github.repository }}"

0 commit comments

Comments
 (0)