Merge pull request #53 from DomainDrivenArchitecture/add_npm_publish

Add npm publish
This commit is contained in:
Dmitri Sotnikov 2020-06-29 15:14:14 -04:00 committed by GitHub
commit f2433d2fef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 49 additions and 22 deletions

View file

@ -1,7 +1,7 @@
name: release prod
on:
push:
tags: '[0-9]+.[0-9]+.[0-9]+'
tags: '[0-9]+.[0-9]+.[0-9]+*'
jobs:
test-matrix:
@ -42,14 +42,8 @@ jobs:
run: |
shadow-cljs release app
chmod a+x mastodon-bot.js
- name: package release
run: |
mkdir -p target/npm-build
cp mastodon-bot.js target/npm-build/
cp package.json target/npm-build/
cp README.md target/npm-build/
tar -cz -C target/npm-build -f target/npm-build.tgz .
sha256sum mastodon-bot.js > target/mastodon-bot.js.sha256
sha512sum mastodon-bot.js > target/mastodon-bot.js.sha512
- name: Create Release
id: create_release
@ -60,10 +54,10 @@ jobs:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: true
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
- name: Upload mastodon-bot.js
id: upload-mastodon-bot-js
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -72,3 +66,38 @@ jobs:
asset_path: ./mastodon-bot.js
asset_name: mastodon-bot.js
asset_content_type: application/json
- 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: application/json
- 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: application/json
- name: upload to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
mkdir -p target/npm-build
cp mastodon-bot.js target/npm-build/
cp target/mastodon-bot.js.sha256 target/npm-build/
cp target/mastodon-bot.js.sha512 target/npm-build/
cp package.json target/npm-build/
cp README.md target/npm-build/
tar -cz -C target/npm-build -f target/npm-build.tgz .
npm publish ./target/npm-build.tgz --access public --dry-run

View file

@ -3,6 +3,8 @@ name: test PR
on:
pull_request:
branches: [ master ]
push:
ingnored-branches: [ 'master' ]
jobs:
test-matrix:

View file

@ -3,9 +3,7 @@ FROM node:10-slim
RUN apt-get update && apt-get install --assume-yes software-properties-common && \
apt-get install --assume-yes git cron
RUN git clone https://github.com/yogthos/mastodon-bot /mastodon-bot && \
cd /mastodon-bot && npm install && \
npm install -g lumo-cljs
RUN npm install -g mastodon-bot
RUN mkdir /config && touch /config/config.edn && touch /var/log/cron.log

View file

@ -6,11 +6,9 @@ the bot will post the timeline from the specified Twitter/Tumblr accounts and RS
### installation
1. prerequisits
1.1 [Node.js](https://nodejs.org/en/)
1.2 npm
2. install with `sudo npm install mastodon-bot -g`
3. run with `mastodon-bot -h`
1. prerequisits: should be installed: [Node.js](https://nodejs.org/en/), npm
2. install mastodon-bot with: `sudo npm install mastodon-bot -g`
3. run with: `mastodon-bot -h`
### usage

View file

@ -2,7 +2,7 @@
"name": "mastodon-bot",
"description": "Bot to publish twitter, tumblr or rss posts to an mastodon account.",
"author": "Dmitri Sotnikov",
"version": "1.0.0",
"version": "1.0.1-dev-0",
"homepage": "https://github.com/yogthos/mastodon-bot",
"repository": "https://github.com/yogthos/mastodon-bot",
"license": "MIT",

View file

@ -3,7 +3,7 @@
while true; do
echo "Polling Bot"
cd /mastodon-bot
npm start
mastodon-bot
echo "Poll done, waiting 600 seconds"
sleep 600
done