node-fetch instead of request
parent
4ecb09274d
commit
c4d85803fb
@ -1,89 +0,0 @@
|
||||
name: stable
|
||||
on:
|
||||
push:
|
||||
tags: '[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
jobs:
|
||||
stable:
|
||||
name: stable
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [14.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: test em
|
||||
run: |
|
||||
npm install
|
||||
npm install -g --save-dev shadow-cljs
|
||||
shadow-cljs compile test
|
||||
|
||||
- name: build em
|
||||
run: |
|
||||
shadow-cljs release app
|
||||
chmod a+x mastodon-bot.js
|
||||
sha256sum mastodon-bot.js > target/mastodon-bot.js.sha256
|
||||
sha512sum mastodon-bot.js > target/mastodon-bot.js.sha512
|
||||
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Release ${{ github.ref }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
- name: Upload mastodon-bot.js
|
||||
id: upload-mastodon-bot-js
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./mastodon-bot.js
|
||||
asset_name: mastodon-bot.js
|
||||
asset_content_type: application/javascript
|
||||
|
||||
- name: Upload mastodon-bot.js.sha256
|
||||
id: upload-mastodon-bot-js-sha256
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./target/mastodon-bot.js.sha256
|
||||
asset_name: mastodon-bot.js.sha256
|
||||
asset_content_type: text/plain
|
||||
|
||||
- name: Upload mastodon-bot.js.sha512
|
||||
id: upload-mastodon-bot-js-sha512
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./target/mastodon-bot.js.sha512
|
||||
asset_name: mastodon-bot.js.sha512
|
||||
asset_content_type: text/plain
|
||||
|
||||
- name: upload to npm
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
run: |
|
||||
mkdir -p target/npm-build/mastodon_bot
|
||||
cp mastodon-bot.js target/npm-build/mastodon_bot/
|
||||
cp target/mastodon-bot.js.sha256 target/npm-build/mastodon_bot/
|
||||
cp target/mastodon-bot.js.sha512 target/npm-build/mastodon_bot/
|
||||
cp package.json target/npm-build/mastodon_bot/
|
||||
cp README.md target/npm-build/mastodon_bot/
|
||||
npm publish ./target/npm-build/mastodon_bot --access public
|
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
@ -0,0 +1,10 @@
|
||||
@startuml
|
||||
"Mastodon-Bot" -> Config: Call rss-sources
|
||||
Config --> "Mastodon-Bot": URL list of rss-sources
|
||||
"Mastodon-Bot" -> "Mastodon-Bot": Call "get-feed" for every rss-source.\nStart asyncronous Promise.
|
||||
activate "Mastodon-Bot"
|
||||
"Mastodon-Bot" -> "RSS-Sources": Call URL to parse RSS-Feed
|
||||
"RSS-Sources" --> "Mastodon-Bot": RSS-Feed
|
||||
"Mastodon-Bot" -> Mastodon: Post feed by post-rss-to-mastodon
|
||||
deactivate "Mastodon-Bot"
|
||||
@enduml
|
@ -0,0 +1,13 @@
|
||||
(ns mastodon-bot.infra-test
|
||||
(:require
|
||||
[cljs.test :refer-macros [deftest is testing run-tests]]
|
||||
[mastodon-bot.infra :as sut]))
|
||||
|
||||
;TODO: mbid test
|
||||
(deftest test-resolve-uri
|
||||
(is (= "https://www.meissa-gmbh.de"
|
||||
(sut/resolve-url ["https://www.meissa-gmbh.de"])))
|
||||
(is (= "https://www.doesnotexist-blablabla.de"
|
||||
(sut/resolve-url ["https://www.doesnotexist-blablabla.de"])))
|
||||
(is (= "http://www.google.de/"
|
||||
(sut/resolve-url ["https://t1p.de/44oo"]))))
|
Reference in New Issue