Skip to content

Commit 03d4813

Browse files
authored
chore: Less CI action duplication (#30)
1 parent 7336bd5 commit 03d4813

File tree

3 files changed

+34
-74
lines changed

3 files changed

+34
-74
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,22 @@ on:
66
pull_request:
77
branches: [main]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
lint-and-build:
15+
# Skip CI on release-please branches - code was already tested
16+
if: ${{ !startsWith(github.head_ref || github.ref_name, 'release-please--') }}
1117
runs-on: ubuntu-latest
1218

1319
steps:
1420
- name: Checkout
15-
uses: actions/checkout@v6
21+
uses: actions/checkout@v4
1622

1723
- name: Setup Node.js
18-
uses: actions/setup-node@v6
24+
uses: actions/setup-node@v4
1925
with:
2026
node-version: '20'
2127
cache: 'npm'
@@ -36,7 +42,7 @@ jobs:
3642
run: npm run build:zip
3743

3844
- name: Upload artifact
39-
uses: actions/upload-artifact@v6
45+
uses: actions/upload-artifact@v4
4046
with:
4147
name: extension-package
4248
path: dist/*.zip

.github/workflows/release.yml

Lines changed: 23 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ on:
55
branches:
66
- main
77

8-
permissions:
9-
contents: write
10-
pull-requests: write
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
1111

1212
jobs:
1313
release-please:
@@ -22,6 +22,7 @@ jobs:
2222
id: release
2323
uses: googleapis/release-please-action@v4
2424
with:
25+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
2526
release-type: node
2627

2728
build-release:
@@ -31,20 +32,17 @@ jobs:
3132

3233
steps:
3334
- name: Checkout
34-
uses: actions/checkout@v6
35+
uses: actions/checkout@v4
3536

3637
- name: Setup Node.js
37-
uses: actions/setup-node@v6
38+
uses: actions/setup-node@v4
3839
with:
3940
node-version: '20'
4041
cache: 'npm'
4142

4243
- name: Install dependencies
4344
run: npm ci
4445

45-
- name: Build validation
46-
run: npm run build
47-
4846
- name: Build all browser packages
4947
run: npm run build:all
5048

@@ -54,50 +52,24 @@ jobs:
5452
tag_name: ${{ needs.release-please.outputs.tag_name }}
5553
files: dist/*.zip
5654

57-
- name: Upload Chrome artifact
58-
uses: actions/upload-artifact@v4
59-
with:
60-
name: chrome-extension
61-
path: dist/*-chrome.zip
62-
63-
- name: Upload Firefox artifact
64-
uses: actions/upload-artifact@v4
65-
with:
66-
name: firefox-extension
67-
path: dist/*-firefox.zip
68-
69-
- name: Upload Opera artifact
70-
uses: actions/upload-artifact@v4
71-
with:
72-
name: opera-extension
73-
path: dist/*-opera.zip
74-
75-
- name: Upload Edge artifact
55+
- name: Upload build artifacts
7656
uses: actions/upload-artifact@v4
7757
with:
78-
name: edge-extension
79-
path: dist/*-edge.zip
58+
name: browser-extensions
59+
path: dist/*.zip
60+
retention-days: 1
8061

8162
publish-to-chrome:
8263
needs: [release-please, build-release]
8364
if: ${{ needs.release-please.outputs.release_created }}
8465
runs-on: ubuntu-latest
8566

8667
steps:
87-
- name: Checkout
88-
uses: actions/checkout@v6
89-
90-
- name: Setup Node.js
91-
uses: actions/setup-node@v6
68+
- name: Download artifacts
69+
uses: actions/download-artifact@v4
9270
with:
93-
node-version: '20'
94-
cache: 'npm'
95-
96-
- name: Install dependencies
97-
run: npm ci
98-
99-
- name: Build Chrome extension
100-
run: npm run build:chrome
71+
name: browser-extensions
72+
path: dist
10173

10274
- name: Upload to Chrome Web Store
10375
uses: mnao305/[email protected]
@@ -116,20 +88,11 @@ jobs:
11688
runs-on: ubuntu-latest
11789

11890
steps:
119-
- name: Checkout
120-
uses: actions/checkout@v6
121-
122-
- name: Setup Node.js
123-
uses: actions/setup-node@v6
91+
- name: Download artifacts
92+
uses: actions/download-artifact@v4
12493
with:
125-
node-version: '20'
126-
cache: 'npm'
127-
128-
- name: Install dependencies
129-
run: npm ci
130-
131-
- name: Build Firefox extension
132-
run: npm run build:firefox
94+
name: browser-extensions
95+
path: dist
13396

13497
- name: Upload to Firefox Add-ons
13598
uses: wdzeng/firefox-addon@v1
@@ -145,25 +108,16 @@ jobs:
145108
runs-on: ubuntu-latest
146109

147110
steps:
148-
- name: Checkout
149-
uses: actions/checkout@v6
150-
151-
- name: Setup Node.js
152-
uses: actions/setup-node@v6
111+
- name: Download artifacts
112+
uses: actions/download-artifact@v4
153113
with:
154-
node-version: '20'
155-
cache: 'npm'
156-
157-
- name: Install dependencies
158-
run: npm ci
159-
160-
- name: Build Edge extension
161-
run: npm run build:edge
114+
name: browser-extensions
115+
path: dist
162116

163117
- name: Upload to Edge Add-ons
164118
uses: wdzeng/edge-addon@v2
165119
with:
166120
product-id: ${{ secrets.EDGE_PRODUCT_ID }}
167121
client-id: ${{ secrets.EDGE_CLIENT_ID }}
168-
client-secret: ${{ secrets.EDGE_CLIENT_SECRET }}
122+
api-key: ${{ secrets.EDGE_API_KEY }}
169123
zip-path: dist/*-edge.zip

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![CI](https://github.com/rfsbraz/Geocaching.com-Friends-Logs/actions/workflows/ci.yml/badge.svg)](https://github.com/rfsbraz/Geocaching.com-Friends-Logs/actions/workflows/ci.yml)
44
[![Chrome Web Store](https://img.shields.io/chrome-web-store/v/bgildcbomgimjfoblhlhmaehaeieeaam)](https://chrome.google.com/webstore/detail/geocachingcom-friends-log/bgildcbomgimjfoblhlhmaehaeieeaam)
5-
[![Firefox Add-ons](https://img.shields.io/amo/v/geocaching-friends-logs)](https://addons.mozilla.org/firefox/addon/geocaching-friends-logs/)
5+
[![Firefox Add-ons](https://img.shields.io/amo/v/geocaching-friends-logs)](https://addons.mozilla.org/firefox/addon/geocaching-com-friends-logs/)
66
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
77

88
A browser extension that displays your friends' geocaching logs at the top of every cache listing page. Never scroll through hundreds of logs again — instantly see which friends have visited a cache and what they thought about it.
@@ -22,7 +22,7 @@ A browser extension that displays your friends' geocaching logs at the top of ev
2222
### Browser Extension Stores (Recommended)
2323

2424
- **Chrome**: [Chrome Web Store](https://chrome.google.com/webstore/detail/geocachingcom-friends-log/bgildcbomgimjfoblhlhmaehaeieeaam)
25-
- **Firefox**: [Firefox Add-ons](https://addons.mozilla.org/firefox/addon/geocaching-friends-logs/)
25+
- **Firefox**: [Firefox Add-ons](https://addons.mozilla.org/firefox/addon/geocaching-com-friends-logs/)
2626
- **Edge**: [Edge Add-ons](https://microsoftedge.microsoft.com/addons/detail/ddbfbobfccafkoabbcmpkbpofbkfgikc)
2727
- **Opera**: [Opera Add-ons](https://addons.opera.com/extensions/details/geocachingcom-friends-logs/)
2828

0 commit comments

Comments
 (0)