-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (35 loc) · 996 Bytes
/
cd.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: Release
on:
push:
branches:
- 'main'
permissions:
contents: write
jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install GitHub CLI
run: sudo apt install -y gh
- name: Authenticate GitHub CLI
run: gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
- name: Read release notes
id: read_release_notes
run: |
RELEASE_NOTES=$(cat RELEASE.md)
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
echo "$RELEASE_NOTES" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Check if tag exists
id: check_tag
run: |
if gh release view "latest" >/dev/null 2>&1; then
gh release delete "latest" -y
fi
- name: Create GitHub Release
run: |
gh release create "latest" --title "latest" --notes "${RELEASE_NOTES}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}