Skip to content

Commit 164aed8

Browse files
authored
Merge pull request #259 from medyo/add-github-avatar
Add GitHub avatar
2 parents abf3eb1 + 232fa20 commit 164aed8

File tree

18 files changed

+206
-165
lines changed

18 files changed

+206
-165
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: '📌 Auto Tag on Master'
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- 'README.md'
9+
- 'LICENSE'
10+
- '.gitignore'
11+
- '.github/**'
12+
- '*.md'
13+
- '.vscode/**'
14+
- 'public/base.manifest.json'
15+
workflow_dispatch:
16+
17+
jobs:
18+
auto-tag:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Get manifest version
26+
id: manifest_version
27+
run: |
28+
version=$(jq -r .version public/base.manifest.json)
29+
echo "version=$version" >> $GITHUB_OUTPUT
30+
31+
- name: Bump version and push tag
32+
id: tag_version
33+
uses: anothrNick/github-tag-action@1.67.0
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
WITH_V: true
37+
DRY_RUN: true
38+
INITIAL_VERSION: ${{ steps.manifest_version.outputs.version }}
39+
RELEASE_BRANCHES: ^(master|main)$
40+
DEFAULT_BUMP: patch
41+
42+
- name: Update manifest version
43+
run: |
44+
new_version=$(echo "${{ steps.tag_version.outputs.new_tag }}" | sed 's/^v//')
45+
jq --arg version "$new_version" '.version = $version' public/base.manifest.json > public/base.manifest.json.tmp && mv public/base.manifest.json.tmp public/base.manifest.json
46+
47+
- name: Commit manifest changes
48+
uses: stefanzweifel/git-auto-commit-action@v6
49+
with:
50+
commit_message: 'ci: Bump manifest version to ${{ steps.tag_version.outputs.new_tag }}'
51+
file_pattern: public/base.manifest.json
52+
- name: Tag branch
53+
run: |
54+
git config --global user.name "github-actions[bot]"
55+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
56+
git tag -a ${{ steps.tag_version.outputs.new_tag }} -m "Tag ${{ steps.tag_version.outputs.new_tag }}."
57+
git push origin ${{ steps.tag_version.outputs.new_tag }}

.github/workflows/deploy.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
name: '✅ [PROD] Deploy main to web environment'
1+
name: '✅ [PROD] Deploy web version'
2+
run-name: Deploy Web app to Production ${{ github.ref_name }}
3+
24
on:
35
workflow_dispatch:
46

@@ -14,10 +16,12 @@ env:
1416
jobs:
1517
build_and_deploy:
1618
runs-on: ubuntu-latest
17-
1819
steps:
1920
- name: Checkout code
20-
uses: actions/checkout@v4
21+
uses: actions/checkout@v6
22+
with:
23+
fetch-depth: 0
24+
ref: ${{ github.ref_name }}
2125

2226
- name: Set up Node.js
2327
uses: actions/setup-node@v4

.github/workflows/develop.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: '👨‍💻 [DEV] Deploy develop to web environment'
1+
name: '👨‍💻 [DEV] Deploy web version'
2+
run-name: Deploy Web app to Development ${{ github.ref_name }}
23
on:
34
workflow_dispatch:
45

@@ -19,7 +20,7 @@ jobs:
1920
- name: Checkout code
2021
uses: actions/checkout@v4
2122
with:
22-
ref: develop
23+
ref: ${{ github.ref_name }}
2324

2425
- name: Set up Node.js
2526
uses: actions/setup-node@v4

.github/workflows/distribute.yml

Lines changed: 34 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
1-
name: '🚀 Deploy to Chrome 🌐 & Firefox 🦊'
2-
1+
name: '🚀 Distribute browser extension'
2+
run-name: Distribute Browser extension ${{ github.ref_name }}
33
on:
44
workflow_dispatch:
55
inputs:
6-
targetStore:
7-
description: 'Store target'
6+
target:
7+
description: 'Select the store to deploy to'
88
required: true
99
default: 'all'
1010
type: choice
1111
options:
1212
- chrome
1313
- firefox
1414
- all
15-
autoTag:
16-
description: 'Auto Create a new tag'
17-
required: true
18-
default: true
19-
type: boolean
20-
testMode:
21-
description: 'Test Mode'
15+
dryrun:
16+
description: 'Run in dry mode without publishing'
2217
required: true
2318
default: false
2419
type: boolean
@@ -32,90 +27,46 @@ env:
3227
VITE_SENTRY_TOKEN: ${{ secrets.VITE_SENTRY_TOKEN }}
3328

3429
jobs:
35-
tag_version:
30+
build-and-deploy:
3631
runs-on: ubuntu-latest
37-
steps:
38-
- uses: actions/checkout@v4
39-
with:
40-
fetch-depth: 0
32+
if: ${{github.ref_type == 'tag' }}
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
browser: [chrome, firefox]
4137

42-
- name: Bump version and push tag
43-
id: tag_version
44-
uses: anothrNick/github-tag-action@1.67.0
45-
env:
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
WITH_V: true
48-
DRY_RUN: ${{ github.event.inputs.autoTag == 'false' }}
49-
50-
- name: Update manifest.json
51-
if: github.event.inputs.autoTag == 'true'
52-
run: |
53-
new_version=$(echo "${{ steps.tag_version.outputs.new_tag }}" | sed 's/^v//')
54-
jq --arg version "$new_version" '.version = $version' public/base.manifest.json > public/base.manifest.json.tmp && mv public/base.manifest.json.tmp public/base.manifest.json
55-
56-
- name: Commit changes
57-
if: github.event.inputs.autoTag == 'true'
58-
uses: EndBug/add-and-commit@v5
59-
with:
60-
branch: ${{ github.ref_name }}
61-
author_name: Github bot
62-
author_email: elmehdi.sakout@gmail.com
63-
message: 'Bump manifest version'
64-
65-
chrome-deploy:
66-
if: ${{ (github.event.inputs.targetStore == 'chrome') || (github.event.inputs.targetStore == 'all') }}
67-
needs: tag_version
68-
runs-on: ubuntu-latest
6938
steps:
70-
- uses: actions/checkout@v4
39+
- uses: actions/checkout@v6
7140
with:
41+
fetch-depth: 0
7242
ref: ${{ github.ref_name }}
73-
- uses: actions/cache@v4
74-
with:
75-
path: '**/node_modules'
76-
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
77-
- name: Set up Node.js
78-
uses: actions/setup-node@v4
43+
44+
- uses: actions/setup-node@v4
7945
with:
8046
node-version: 18
81-
- name: Install yarn dependencies
82-
run: yarn
47+
cache: 'yarn'
8348

84-
- name: Build and zip the extension
85-
run: yarn build:chrome
49+
- run: yarn install --frozen-lockfile
8650

87-
- name: Upload the package to Chrome web store
88-
if: ${{ github.event.inputs.testMode == 'false' }}
89-
run: npx chrome-webstore-upload-cli@3 upload --source chrome_extension.zip --extension-id $EXTENSION_ID --auto-publish
51+
- name: 'Build Extension'
52+
if: ${{ github.event.inputs.target == 'all' || github.event.inputs.target == matrix.browser }}
53+
run: yarn build:${{ matrix.browser }}
54+
55+
- name: '⬆️ Upload to Chrome Web Store'
56+
if: ${{ (github.event.inputs.target == 'all' || github.event.inputs.target == 'chrome') && matrix.browser == 'chrome' && github.event.inputs.dryrun == 'false' }}
57+
run: >
58+
npx chrome-webstore-upload-cli@3 upload
59+
--source chrome_extension.zip
60+
--extension-id ${{ secrets.CHROME_EXTENSION_ID }}
61+
--auto-publish
9062
env:
9163
EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
92-
CLIENT_ID: ${{secrets.CHROME_EXTENSION_CLIENT_ID}}
93-
REFRESH_TOKEN: ${{secrets.CHROME_EXTENSION_REFRESH_TOKEN}}
94-
CLIENT_SECRET: ${{secrets.CHROME_EXTENSION_CLIENT_SECRET}}
95-
96-
firefox-deploy:
97-
if: ${{ (github.event.inputs.targetStore == 'firefox') || (github.event.inputs.targetStore == 'all') }}
98-
needs: tag_version
99-
runs-on: ubuntu-latest
100-
steps:
101-
- uses: actions/checkout@v4
102-
with:
103-
ref: ${{ github.ref_name }}
104-
- uses: actions/cache@v4
105-
with:
106-
path: '**/node_modules'
107-
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
108-
- name: Set up Node.js
109-
uses: actions/setup-node@v4
110-
with:
111-
node-version: 18
112-
- name: Install yarn dependencies
113-
run: yarn
64+
CLIENT_ID: ${{ secrets.CHROME_EXTENSION_CLIENT_ID }}
65+
CLIENT_SECRET: ${{ secrets.CHROME_EXTENSION_CLIENT_SECRET }}
66+
REFRESH_TOKEN: ${{ secrets.CHROME_EXTENSION_REFRESH_TOKEN }}
11467

115-
- name: Build and zip the extension
116-
run: yarn build:firefox
117-
- name: Upload the package to Firefox web store
118-
if: ${{ github.event.inputs.testMode == 'false' }}
68+
- name: '⬆️ Upload to Firefox Add-on Store'
69+
if: ${{ (github.event.inputs.target == 'all' || github.event.inputs.target == 'firefox') && matrix.browser == 'firefox' && github.event.inputs.dryrun == 'false' }}
11970
uses: wdzeng/firefox-addon@v1
12071
with:
12172
jwt-issuer: ${{ secrets.WEB_EXT_API_KEY }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Even more features are going to come in the future!
4848
- Freecodecamp
4949
- Medium
5050
- Indiehackers
51+
- Hackernoon
5152
- Custom RSS Feed
5253
- **or create an issue to ask for a new data source**
5354

public/base.manifest.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22
"manifest_version": 3,
33
"name": "Hackertab.dev - developer news",
44
"description": "All developer news in one tab",
5-
"version": "1.24.4",
5+
"version": "1.25.3",
66
"chrome_url_overrides": {
77
"newtab": "index.html"
88
},
9-
"host_permissions": ["https://*.hackertab.dev/*"],
9+
"host_permissions": [
10+
"https://*.hackertab.dev/*"
11+
],
1012
"content_scripts": [
1113
{
12-
"matches": ["https://hackertab.dev/*"],
14+
"matches": [
15+
"https://hackertab.dev/*"
16+
],
1317
"run_at": "document_start",
14-
"js": ["content.js"]
18+
"js": [
19+
"content.js"
20+
]
1521
}
1622
],
1723
"icons": {

src/assets/App.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,11 @@ a {
396396
border: 1px solid var(--chip-border-color);
397397
background-color: var(--chip-background);
398398
font-size: 0.9em;
399+
400+
max-width: 80px;
401+
white-space: nowrap;
402+
overflow: hidden;
403+
text-overflow: ellipsis;
399404
}
400405
.blockHeaderIcon {
401406
display: flex;
@@ -630,6 +635,14 @@ a {
630635
color: #99a2ac;
631636
}
632637

638+
.rowTitleGithubIcon {
639+
width: 16px;
640+
height: 16px;
641+
border-radius: 4px;
642+
vertical-align: sub;
643+
margin-right: 6px;
644+
}
645+
633646
.backToHome {
634647
display: flex;
635648
order: 4;

src/components/Elements/UserTags/UserTags.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const UserTags = () => {
2727
<div className="tags">
2828
{userSelectedTags.map((tag, index) => (
2929
<button key={index} className="tag tagHoverable" onClick={() => onTagClicked(tag.value)}>
30-
{tag.value}
30+
{tag.label}
3131
</button>
3232
))}
3333
<Link to="/settings/topics" className="tag tagHoverable" aria-label="Open settings">

src/features/cards/components/githubCard/RepoItem.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { CardItemWithActions, CardLink } from 'src/components/Elements'
22

3-
import { VscRepo, VscRepoForked, VscStarFull } from 'react-icons/vsc'
3+
import { VscRepoForked, VscStarFull } from 'react-icons/vsc'
44
import { ColoredLanguagesBadge } from 'src/components/Elements'
55
import { Attributes } from 'src/lib/analytics'
66
import { useUserPreferences } from 'src/stores/preferences'
@@ -30,7 +30,10 @@ const RepoItem = ({ item, selectedTag, analyticsTag }: BaseItemPropsType<Reposit
3030
[Attributes.SOURCE]: analyticsTag,
3131
[Attributes.LANGUAGE]: selectedTag?.value,
3232
}}>
33-
<VscRepo className={'rowTitleIcon'} />
33+
<img
34+
src={`https://github.com/${item.owner}.png?size=64`}
35+
className="rowTitleGithubIcon"
36+
/>
3437
{item.owner}/{item.name}
3538
</CardLink>
3639
<p className="rowDescription">{item.description}</p>

src/features/cards/components/hackernewsCard/ArticleItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ const ArticleItem = (props: BaseItemPropsType<Article>) => {
4747
<MdAccessTime className="rowItemIcon" /> {format(new Date(item.published_at))}
4848
</span>
4949
<ClickableItem
50-
link={`https://news.ycombinator.com/item?id=${item.id}`}
50+
link={item.canonical_url || 'https://news.ycombinator.com/'}
5151
className="rowItem rowItemClickable"
5252
analyticsAttributes={{
5353
[Attributes.POINTS]: item.comments_count,
5454
[Attributes.TRIGERED_FROM]: 'card',
5555
[Attributes.TITLE]: `${item.title} comments`,
56-
[Attributes.LINK]: `https://news.ycombinator.com/item?id=${item.id}`,
56+
[Attributes.LINK]: item.canonical_url,
5757
[Attributes.SOURCE]: analyticsTag,
5858
}}>
5959
<BiCommentDetail className="rowItemIcon" /> {item.comments_count} comments

0 commit comments

Comments
 (0)