-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (65 loc) · 2.12 KB
/
Copy pathrelease.yml
File metadata and controls
76 lines (65 loc) · 2.12 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
name: Release
on:
push:
branches:
- main
paths:
- 'SKILL.md'
- 'README.md'
- '.github/workflows/release.yml'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version from SKILL.md
id: version
run: |
VERSION=$(grep "version:" SKILL.md | head -1 | awk '{print $2}')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Check if release exists
id: check_release
run: |
if gh release view v${{ steps.version.outputs.version }} 2>/dev/null; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build .skill file
if: steps.check_release.outputs.exists == 'false'
run: |
zip -r agent-os-bootstrap.skill . -x ".git*" "*.DS_Store" ".github/workflows*"
- name: Get commit message
id: commit_msg
run: |
MSG=$(git log -1 --pretty=%B)
MSG="${MSG//'%'/'%25'}"
MSG="${MSG//$'\n'/'%0A'}"
MSG="${MSG//$'\r'/'%0D'}"
echo "message=$MSG" >> $GITHUB_OUTPUT
- name: Create Release
if: steps.check_release.outputs.exists == 'false'
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.version.outputs.version }}
name: v${{ steps.version.outputs.version }}
body: |
## Changes
${{ steps.commit_msg.outputs.message }}
files: |
agent-os-bootstrap.skill
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Notify Slack (optional)
if: steps.check_release.outputs.exists == 'false'
run: |
curl -X POST -H 'Content-type: application/json' \
--data '{"text":"BoS OS Bootstrap v${{ steps.version.outputs.version }} released"}' \
${{ secrets.SLACK_WEBHOOK_URL }} || true