-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (50 loc) · 1.87 KB
/
Copy pathrelease.yml
File metadata and controls
60 lines (50 loc) · 1.87 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
name: Create Release
on:
push:
tags:
- 'v*' # Trigger on version tags like v0.1.0, v1.0.0, etc.
permissions:
contents: write
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Extract version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Extract changelog for this version
id: changelog
run: |
if [ -f CHANGELOG.md ]; then
VERSION="${{ steps.get_version.outputs.VERSION }}"
VERSION_ESCAPED=$(echo "$VERSION" | sed 's/\./\\./g')
CHANGES=$(awk "/^## \[$VERSION_ESCAPED\]/{p=1;next} /^## \[/{p=0} p" CHANGELOG.md)
if [ -z "$CHANGES" ]; then
echo "CHANGELOG_CONTENT=No changelog entry found for this version." >> $GITHUB_OUTPUT
else
echo "CHANGELOG_CONTENT<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
fi
else
echo "CHANGELOG_CONTENT=CHANGELOG.md not found." >> $GITHUB_OUTPUT
fi
- name: Create header archive
run: |
zip -r ./hyperliquid-cpp-${{ steps.get_version.outputs.VERSION }}.zip include/
tar -czf ./hyperliquid-cpp-${{ steps.get_version.outputs.VERSION }}.tar.gz include/
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ github.ref_name }}
body: |
## Changes
${{ steps.changelog.outputs.CHANGELOG_CONTENT }}
draft: true
prerelease: false
generate_release_notes: false
files: |
hyperliquid-cpp-${{ steps.get_version.outputs.VERSION }}.zip
hyperliquid-cpp-${{ steps.get_version.outputs.VERSION }}.tar.gz