Skip to content

Commit

Permalink
feat: add updates feed (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
GabsEdits authored Aug 4, 2024
1 parent 34ab3ae commit 489d676
Show file tree
Hide file tree
Showing 8 changed files with 182 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/generate-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,29 @@ jobs:
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

generate-feed:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: latest

- name: Generate feed
run: node ./scripts/generateFeed.cjs

- name: Commit and push
if: github.repository == 'vanilla-os/info' && github.ref == 'refs/heads/main'
continue-on-error: true
run: |
git config user.name github-actions
git config user.email [email protected]
git add updates/_index.json
git commit -m "chore: new updates index"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
55 changes: 55 additions & 0 deletions scripts/generateUpdatesFeed.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const { Feed } = require('feed');
const fs = require('fs');
const path = require('path');

// Read the JSON file
const data = JSON.parse(fs.readFileSync(path.join(__dirname, '../updates/_index.json'), 'utf8'));

// Initialize the feed
const feed = new Feed({
title: 'Vanilla OS Updates',
description: 'Live feed of Vanilla OS updates and changes.',
id: 'https://info.vanillaos.org/updates-feed.xml',
link: 'https://vanillaos.org/',
language: 'en',
updated: new Date(),
feedLinks: {
atom: 'https://info.vanillaos.org/updates-feed.xml',
},
author: {
name: 'Vanilla OS',
email: '[email protected]',
link: 'https://vanillaos.org/',
}
});

// Process the JSON data and add items to the feed
Object.keys(data).forEach((date) => {
const bugs = data[date].bugs || [];
const enhancements = data[date].enhancements || [];

bugs.forEach((bug) => {
feed.addItem({
title: `Bug Fix: ${bug.title}`,
id: bug.link || '',
link: bug.link || '',
description: `Affected: ${bug.affected}. Fixed in version: ${bug.fixed || 'N/A'}.`,
date: new Date(date),
});
});

enhancements.forEach((enhancement) => {
feed.addItem({
title: `Enhancement: ${enhancement.title}`,
id: enhancement.link || '',
link: enhancement.link || '',
description: `${enhancement.description || ''} Version: ${enhancement.version || 'N/A'}.`,
date: new Date(date),
});
});
});

// Write the Atom feed to a file
fs.writeFileSync(path.join(__dirname, '../updates-feed.xml'), feed.atom1());

console.log('Atom feed generated.');
11 changes: 11 additions & 0 deletions scripts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"scripts": {
"generate-updates-feed": "node generateAtomFeed.cjs"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"feed": "^4.2.2"
}
}
38 changes: 38 additions & 0 deletions scripts/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions updates-feed.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id>https://info.vanillaos.org/updates-feed.xml</id>
<title>Vanilla OS Updates</title>
<updated>2024-08-03T20:07:12.354Z</updated>
<generator>https://github.com/jpmonette/feed</generator>
<author>
<name>Vanilla OS</name>
<email>[email protected]</email>
<uri>https://vanillaos.org/</uri>
</author>
<link rel="alternate" href="https://vanillaos.org/"/>
<link rel="self" href="https://info.vanillaos.org/updates-feed.xml"/>
<subtitle>Live feed of Vanilla OS updates and changes.</subtitle>
<entry>
<title type="html"><![CDATA[Bug Fix: Newly created users were not able to complete the First Setup Wizard]]></title>
<id>https://github.com/Vanilla-OS/first-setup/releases/tag/v2.2.3</id>
<link href="https://github.com/Vanilla-OS/first-setup/releases/tag/v2.2.3"/>
<updated>2024-07-31T21:00:00.000Z</updated>
<summary type="html"><![CDATA[Affected: Newly created users. Fixed in version: 2.2.3.]]></summary>
</entry>
<entry>
<title type="html"><![CDATA[Bug Fix: Some NVIDIA setups were unable to boot]]></title>
<id/>
<link href=""/>
<updated>2024-07-31T21:00:00.000Z</updated>
<summary type="html"><![CDATA[Affected: NVIDIA users on some specific setups. Fixed in version: N/A.]]></summary>
</entry>
<entry>
<title type="html"><![CDATA[Enhancement: Support for custom images in the Installer]]></title>
<id>https://github.com/Vanilla-OS/vanilla-installer/releases/tag/v2.3.7</id>
<link href="https://github.com/Vanilla-OS/vanilla-installer/releases/tag/v2.3.7"/>
<updated>2024-07-31T21:00:00.000Z</updated>
<summary type="html"><![CDATA[Users can now use their own system images during the installation process. Usefull for OEMs and users who need specific firmware or drivers. Version: 2.3.7.]]></summary>
</entry>
<entry>
<title type="html"><![CDATA[Enhancement: Support for new NVIDIA images in the installer]]></title>
<id/>
<link href=""/>
<updated>2024-07-31T21:00:00.000Z</updated>
<summary type="html"><![CDATA[We have 2 different images for NVIDIA now, one for recent GPUs using the official Open NVIDIA drivers, one for old GPUs using the official proprietary NVIDIA drivers; the installer will automatically detect the hardware and pick the correct one. Version: N/A.]]></summary>
</entry>
<entry>
<title type="html"><![CDATA[Enhancement: New and improved translations]]></title>
<id/>
<link href=""/>
<updated>2024-07-31T21:00:00.000Z</updated>
<summary type="html"><![CDATA[One or more of the supported languages have been updated. Version: N/A.]]></summary>
</entry>
</feed>
File renamed without changes.
2 changes: 1 addition & 1 deletion updates/_index.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"01-08-2024": {
"08-01-2024": {
"bugs": [
{
"title": "Newly created users were not able to complete the First Setup Wizard",
Expand Down

0 comments on commit 489d676

Please sign in to comment.