From 82d2a7b10f1b445f55545b7e25352dd6df4fa64d Mon Sep 17 00:00:00 2001 From: jem Date: Mon, 29 Jun 2020 19:42:28 +0200 Subject: [PATCH 1/8] test should work on every branch --- .github/workflows/test-pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 7a6fa8b..58ee046 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -3,6 +3,7 @@ name: test PR on: pull_request: branches: [ master ] + push: [ '!master' ] jobs: test-matrix: From 1b43d0ecda0e3152c725b0eecf3ca820c5361ab9 Mon Sep 17 00:00:00 2001 From: jem Date: Mon, 29 Jun 2020 19:42:44 +0200 Subject: [PATCH 2/8] fix format --- .github/workflows/release.yml | 2 +- README.md | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ee282c3..67eb2f2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,7 +60,7 @@ jobs: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} draft: false - prerelease: true + prerelease: false - name: Upload Release Asset id: upload-release-asset diff --git a/README.md b/README.md index 07455c0..71ffc50 100644 --- a/README.md +++ b/README.md @@ -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 From 57376d2e152794c5b4f52d8b14d9c7ac26784c76 Mon Sep 17 00:00:00 2001 From: jem Date: Mon, 29 Jun 2020 19:55:28 +0200 Subject: [PATCH 3/8] increase version for improved release publishing ci --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 70e97a2..7ef4a2a 100644 --- a/package.json +++ b/package.json @@ -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", From 8999359ae630db61b9ed37173f79f00b1757cdec Mon Sep 17 00:00:00 2001 From: jem Date: Mon, 29 Jun 2020 19:55:57 +0200 Subject: [PATCH 4/8] adjust to new npm published package --- Dockerfile | 4 +--- poll.sh | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 69159a2..027ace7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/poll.sh b/poll.sh index 74b2ce3..5896538 100644 --- a/poll.sh +++ b/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 From 9a856e2cdc14918ea1392ee251ff92a8853ad0f1 Mon Sep 17 00:00:00 2001 From: jem Date: Mon, 29 Jun 2020 20:08:45 +0200 Subject: [PATCH 5/8] add shasum & allow 0.0.0-sth tags --- .github/workflows/release.yml | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 67eb2f2..955571d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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,11 +42,15 @@ jobs: 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: package release 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 . @@ -62,8 +66,8 @@ jobs: draft: false 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 +76,25 @@ 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 From f4e9a44f37fbb4e4fa0d0ae6ae617af802361bb5 Mon Sep 17 00:00:00 2001 From: jem Date: Mon, 29 Jun 2020 20:10:42 +0200 Subject: [PATCH 6/8] fix PR test --- .github/workflows/test-pr.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 58ee046..5476229 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -3,7 +3,8 @@ name: test PR on: pull_request: branches: [ master ] - push: [ '!master' ] + push: + branches: [ '!master' ] jobs: test-matrix: From 87c5707e9ceb8387d01c9eb9f10543e163c4f164 Mon Sep 17 00:00:00 2001 From: jem Date: Mon, 29 Jun 2020 20:12:14 +0200 Subject: [PATCH 7/8] next try --- .github/workflows/test-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 5476229..44febd0 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -4,7 +4,7 @@ on: pull_request: branches: [ master ] push: - branches: [ '!master' ] + ingnored-branches: [ 'master' ] jobs: test-matrix: From be5703273c5689f5363e0b8b9966ebaa2e99564b Mon Sep 17 00:00:00 2001 From: jem Date: Mon, 29 Jun 2020 20:27:01 +0200 Subject: [PATCH 8/8] add npm-publish --- .github/workflows/release.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 955571d..32d82c9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,16 +45,6 @@ jobs: sha256sum mastodon-bot.js > target/mastodon-bot.js.sha256 sha512sum mastodon-bot.js > target/mastodon-bot.js.sha512 - - name: package release - 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 . - - name: Create Release id: create_release uses: actions/create-release@v1 @@ -98,3 +88,16 @@ jobs: 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