-
Notifications
You must be signed in to change notification settings - Fork 30
64 lines (56 loc) · 1.78 KB
/
github-release.yml
File metadata and controls
64 lines (56 loc) · 1.78 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
name: Publish release
on:
pull_request:
types: [closed]
branches:
- "master"
push:
tags:
- "v*"
permissions:
contents: write
id-token: write
jobs:
release_gh:
name: GitHub Release
if: contains(github.event.pull_request.labels.*.name, 'release')
runs-on: ubuntu-latest
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v6
- name: Get latest version
run: |
echo "PACKAGE_VERSION=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2 | tr -d '\r')" >> $GITHUB_ENV
- name: Download dSYMs
if: github.event_name == 'pull_request'
env:
PR_BODY: ${{ github.event.pull_request.body }}
run: |
url=$(echo "$PR_BODY" | grep -oE 'https://[^ )]*dSYMs\.zip' | head -n 1)
if [ -n "$url" ]; then
echo "Found dSYMs URL: $url"
curl -L -o dSYMs.zip "$url"
else
echo "No dSYMs.zip URL found in PR body."
fi
- name: Generate Changelog
run: awk '/^## \[/{if (f) exit; f=1; next} f' CHANGELOG.md > RELEASE_NOTES.md
- name: 🏷️ Push Release Tag
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git tag v${{ env.PACKAGE_VERSION }}
git push origin v${{ env.PACKAGE_VERSION }}
fi
- name: GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
FILES=""
if [ -f dSYMs.zip ]; then
FILES="dSYMs.zip"
fi
gh release create v${{ env.PACKAGE_VERSION }} \
--title "freeRASP ${{ env.PACKAGE_VERSION }}" \
--notes-file RELEASE_NOTES.md \
$FILES