From dd2a9f76e05f74de0a660ea2778b9b3c80cf143a Mon Sep 17 00:00:00 2001 From: Sai Karthik Date: Sat, 23 Nov 2024 15:32:24 +0530 Subject: [PATCH] ci: build a sample feed --- .github/workflows/{deno.yml => build.yml} | 10 +++++----- README.md | 16 ++++++++++------ deno.json | 5 +++-- main.ts | 2 +- 4 files changed, 19 insertions(+), 14 deletions(-) rename .github/workflows/{deno.yml => build.yml} (84%) diff --git a/.github/workflows/deno.yml b/.github/workflows/build.yml similarity index 84% rename from .github/workflows/deno.yml rename to .github/workflows/build.yml index 54ff852..4e04a23 100644 --- a/.github/workflows/deno.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,7 @@ # This workflow will install Deno then run `deno lint` and `deno test`. # For more information see: https://github.com/denoland/setup-deno -name: Deno +name: Build on: push: @@ -29,12 +29,12 @@ jobs: uses: denoland/setup-deno@v2 with: deno-version: v2.x - # Uncomment this step to verify the use of 'deno fmt' on each commit. + - name: Verify formatting run: deno fmt --check - + - name: Run linter run: deno lint - - name: Build - run: deno run main.ts + - name: Create feed + run: deno task run feed.xml diff --git a/README.md b/README.md index 564dc24..890781d 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,25 @@ # gstfeed -A simple tool which converts News and updates from the Indian [GST portal](https://gst.gov.in) as RSS (atom) feeds -which can then be used in various integrations (like feed readers, bots) +A simple tool which converts News and updates from the Indian +[GST portal](https://gst.gov.in) as RSS (atom) feeds which can then be used in +various integrations (like feed readers, bots) # Installation ## Build Requirements + - [Deno](https://deno.com) ## Usage + To run the script: ``` -deno run main.ts +deno task run ``` -This will generate the `feed.xml` in the same directory which can be copied to any location of choice. +This will generate the `feed.xml` in the same directory which can be copied to +any location of choice. The script optionally accepts custom path to the feed output as first argument @@ -29,7 +33,7 @@ To compile as binary: deno task build ``` -For development +For development: ``` deno task dev @@ -37,4 +41,4 @@ deno task dev # License -this script is licensed under the GNU `GPLv3` +This script is licensed under the GNU `GPLv3` diff --git a/deno.json b/deno.json index d629982..eb76b99 100644 --- a/deno.json +++ b/deno.json @@ -1,7 +1,8 @@ { "tasks": { - "dev": "deno run --watch --allow-net main.ts" - "build": "deno compile --allow-net main.ts " + "dev": "deno run --watch --allow-net --allow-write main.ts", + "build": "deno compile --allow-net --allow-write main.ts", + "run": "deno run --allow-net --allow-write main.ts" }, "imports": { "@feed/feed": "jsr:@feed/feed@^1.1.0" diff --git a/main.ts b/main.ts index 408ab30..ca59020 100644 --- a/main.ts +++ b/main.ts @@ -43,7 +43,7 @@ async function fetchPayload() { link: `https://www.gst.gov.in/newsandupdates/read/${item.id}`, id: `${item.id}`, updated: formatDate(item.date), - summary: "item.title", + summary: item.title, content: { body: item.content, type: "html",