-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (97 loc) · 4.18 KB
/
Copy pathrelease.yml
File metadata and controls
125 lines (97 loc) · 4.18 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build-and-release:
name: Build and Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Generate icons
run: npm run icons
- name: Build Chrome extension
run: npm run build:chrome
- name: Build Firefox extension
run: npm run build:firefox
- name: Build Edge extension
run: npm run build:edge
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Create zip files
run: |
cd dist
zip -r ../filigran-xtm-chrome-${{ steps.get_version.outputs.VERSION }}.zip chrome/
zip -r ../filigran-xtm-firefox-${{ steps.get_version.outputs.VERSION }}.zip firefox/
zip -r ../filigran-xtm-edge-${{ steps.get_version.outputs.VERSION }}.zip edge/
cd ..
- name: Extract changelog for version
id: changelog
run: |
VERSION="${{ steps.get_version.outputs.VERSION }}"
# Extract the section for this version from CHANGELOG.md
# Match from "## [VERSION]" until the next "## [" or end of file
CHANGELOG_CONTENT=$(awk -v ver="$VERSION" '
BEGIN { found=0; content="" }
/^## \[/ {
if (found) exit
if ($0 ~ "\\[" ver "\\]") { found=1; next }
}
found { content = content $0 "\n" }
END { print content }
' CHANGELOG.md)
# If no changelog found for this version, use a default message
if [ -z "$CHANGELOG_CONTENT" ]; then
CHANGELOG_CONTENT="No changelog entry found for version $VERSION."
fi
# Write to file for the release
echo "$CHANGELOG_CONTENT" > changelog_section.md
- name: Generate Release Notes
run: |
VERSION="${{ steps.get_version.outputs.VERSION }}"
cat << 'HEADER' > release_notes.md
## Filigran XTM Browser Extension v${{ steps.get_version.outputs.VERSION }}
HEADER
# Append the changelog content
cat changelog_section.md >> release_notes.md
cat << 'FOOTER' >> release_notes.md
---
### Downloads
| Browser | File | Installation |
|---------|------|--------------|
| Chrome | `filigran-xtm-chrome-${{ steps.get_version.outputs.VERSION }}.zip` | Load unpacked in `chrome://extensions/` |
| Firefox | `filigran-xtm-firefox-${{ steps.get_version.outputs.VERSION }}.zip` | Load temporary add-on in `about:debugging` |
| Edge | `filigran-xtm-edge-${{ steps.get_version.outputs.VERSION }}.zip` | Load unpacked in `edge://extensions/` |
### Installation Instructions
1. Download the appropriate zip file for your browser
2. Extract the zip file to a folder
3. Open your browser's extension management page
4. Enable "Developer mode"
5. Click "Load unpacked" and select the extracted folder
For full documentation, see the [README](https://github.com/FiligranHQ/xtm-browser-extension#readme).
FOOTER
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: v${{ steps.get_version.outputs.VERSION }}
body_path: release_notes.md
draft: false
prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') || contains(github.ref, '-rc') }}
files: |
filigran-xtm-chrome-${{ steps.get_version.outputs.VERSION }}.zip
filigran-xtm-firefox-${{ steps.get_version.outputs.VERSION }}.zip
filigran-xtm-edge-${{ steps.get_version.outputs.VERSION }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}