-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (62 loc) · 2.07 KB
/
release.yml
File metadata and controls
74 lines (62 loc) · 2.07 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
name: Release Chrome Extension
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
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: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Validate Extension
run: npm run validate
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Validate CHANGELOG.md
run: |
VERSION="${{ steps.get_version.outputs.VERSION }}"
if ! grep -q "## \[$VERSION\]" CHANGELOG.md; then
echo "❌ Error: CHANGELOG.md does not contain an entry for version $VERSION"
echo "Please add a changelog entry with the format: ## [$VERSION] - YYYY-MM-DD"
exit 1
fi
echo "✅ CHANGELOG.md contains entry for version $VERSION"
- name: Create Release Zip
run: |
zip -r devwatch-github-v${{ steps.get_version.outputs.VERSION }}.zip \
manifest.json \
background.js \
popup \
options \
icons \
shared \
LICENSE \
README.md \
CHANGELOG.md
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: devwatch-github-v${{ steps.get_version.outputs.VERSION }}.zip
generate_release_notes: true
draft: false
prerelease: false
- name: Publish to Chrome Web Store
uses: mnao305/chrome-extension-upload@v5.0.0
with:
file-path: devwatch-github-v${{ steps.get_version.outputs.VERSION }}.zip
extension-id: ${{ secrets.CHROME_EXTENSION_ID }}
client-id: ${{ secrets.CHROME_CLIENT_ID }}
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
publish: true