Merge pull request #53 from DomainDrivenArchitecture/add_npm_publish
Add npm publish
This commit is contained in:
commit
f2433d2fef
6 changed files with 49 additions and 22 deletions
53
.github/workflows/release.yml
vendored
53
.github/workflows/release.yml
vendored
|
@ -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
|
||||
|
|
2
.github/workflows/test-pr.yml
vendored
2
.github/workflows/test-pr.yml
vendored
|
@ -3,6 +3,8 @@ name: test PR
|
|||
on:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
push:
|
||||
ingnored-branches: [ 'master' ]
|
||||
|
||||
jobs:
|
||||
test-matrix:
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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",
|
||||
|
|
2
poll.sh
2
poll.sh
|
@ -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
|
||||
|
|
Reference in a new issue