-
Notifications
You must be signed in to change notification settings - Fork 18
80 lines (66 loc) · 2.04 KB
/
publish-release.yml
File metadata and controls
80 lines (66 loc) · 2.04 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
76
77
78
79
80
name: Publish new release
on:
pull_request:
types: [closed]
branches:
- "master"
push:
tags:
- "v*"
permissions:
contents: write
id-token: write
jobs:
release_gh:
name: Create new GitHub release
if: contains(github.event.pull_request.labels.*.name, 'release')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup
uses: ./.github/actions/setup
- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Generate Changelog
run: node ./scripts/extract_changelog.js > ${{ github.workspace }}-CURRENT_CHANGELOG.md
- name: Get latest version
run: echo "PACKAGE_VERSION=$(node scripts/extract_version.js)" >> $GITHUB_ENV
- name: Download dSYMs
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: 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 ${{ github.workspace }}-CURRENT_CHANGELOG.md \
$FILES
publish_npmjs:
name: Publish release to npm.js
needs: release_gh
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup
uses: ./.github/actions/setup
- name: Configure git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Publish package
run: npm publish