Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

Commit

Permalink
Merge pull request #53 from DomainDrivenArchitecture/add_npm_publish
Browse files Browse the repository at this point in the history
Add npm publish
  • Loading branch information
yogthos committed Jun 29, 2020
2 parents 0f0e380 + be57032 commit f2433d2
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 22 deletions.
53 changes: 41 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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 }}
Expand All @@ -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
2 changes: 2 additions & 0 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: test PR
on:
pull_request:
branches: [ master ]
push:
ingnored-branches: [ 'master' ]

jobs:
test-matrix:
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion poll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f2433d2

Please sign in to comment.