-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (70 loc) · 2.37 KB
/
Copy pathrelease.yml
File metadata and controls
85 lines (70 loc) · 2.37 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
81
82
83
84
85
name: Release
on:
workflow_dispatch:
permissions:
contents: write
id-token: write
jobs:
test:
uses: ./.github/workflows/test.yml
release:
name: Build & Release
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Extract version from changelog
id: version
run: |
VERSION=$(sed -n 's/^## \[\([^]]*\)\].*/\1/p' CHANGELOG.md | head -1)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Extract changelog
id: changelog
run: |
CONTENT=$(awk '
/^## \[/ {
if (found) exit
found=1
next
}
found { print }
' CHANGELOG.md)
echo "content<<EOF" >> $GITHUB_OUTPUT
echo "$CONTENT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Update version
run: |
VERSION=${{ steps.version.outputs.version }}
sed -i 's/public static let version = ".*"/public static let version = "'"$VERSION"'"/' kit/src/PWAKitCore/PWAKitCore.swift
cd sdk && npm version "$VERSION" --no-git-tag-version --allow-same-version
cd ../cli && npm version "$VERSION" --no-git-tag-version --allow-same-version
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
- name: Package template
run: |
tar -czf pwakit-template.tar.gz \
--exclude='kit/src/PWAKit/Resources/pwa-config.json' \
--exclude='kit/src/PWAKit/Resources/AppIcon-source.png' \
kit/PWAKitApp.xcodeproj/ \
kit/src/PWAKit/ \
kit/src/PWAKitCore/
- name: Build CLI
run: make cli/deps cli/build
- name: Publish CLI
working-directory: cli
run: npm publish --provenance --access public --ignore-scripts
- name: Build SDK
run: make sdk/deps sdk/build
- name: Publish SDK
working-directory: sdk
run: npm publish --provenance --access public --ignore-scripts
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.version }}
name: v${{ steps.version.outputs.version }}
body: ${{ steps.changelog.outputs.content }}
files: pwakit-template.tar.gz