From e84079fb3da71a1123796ef2f83fea0aea1473fc Mon Sep 17 00:00:00 2001 From: jem Date: Mon, 13 Jul 2020 18:31:18 +0200 Subject: [PATCH 1/6] going to separate stable & unstable build --- .github/workflows/release.yml | 37 +++++++++++++++++------------------ RELEASING.md | 2 +- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 32d82c9..cd06348 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,11 +1,11 @@ -name: release prod +name: stable on: push: tags: '[0-9]+.[0-9]+.[0-9]+*' jobs: - test-matrix: - name: matrix test + stable: + name: stable runs-on: ubuntu-latest strategy: matrix: @@ -13,19 +13,6 @@ jobs: steps: - uses: actions/checkout@v2 - - - name: Cache node modules - uses: actions/cache@v2 - env: - cache-name: cache-node-modules - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 @@ -44,6 +31,7 @@ jobs: chmod a+x mastodon-bot.js sha256sum mastodon-bot.js > target/mastodon-bot.js.sha256 sha512sum mastodon-bot.js > target/mastodon-bot.js.sha512 + shadow-cljs run shadow.cljs.build-report app target/build-report.html - name: Create Release id: create_release @@ -65,7 +53,7 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./mastodon-bot.js asset_name: mastodon-bot.js - asset_content_type: application/json + asset_content_type: application/javascript - name: Upload mastodon-bot.js.sha256 id: upload-mastodon-bot-js-sha256 @@ -76,7 +64,7 @@ jobs: 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 + asset_content_type: text/plain - name: Upload mastodon-bot.js.sha512 id: upload-mastodon-bot-js-sha512 @@ -87,7 +75,18 @@ jobs: 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 + asset_content_type: text/plain + + - name: Upload build-report + id: build-report + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./target/build-report + asset_name: build-report.html + asset_content_type: text/html - name: upload to npm env: diff --git a/RELEASING.md b/RELEASING.md index a427a09..9757d07 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -32,7 +32,7 @@ shadow-cljs release app shadow-cljs release app chmod a+x mastodon-bot.js rm -rf target/npm-build -mkdir target/npm-build +mkdir -p target/npm-build cp mastodon-bot.js target/npm-build/ cp package.json target/npm-build/ cp README.md target/npm-build/ From 3a674288e4fcd0967654daae9e2801252634ef0e Mon Sep 17 00:00:00 2001 From: jem Date: Mon, 13 Jul 2020 18:35:19 +0200 Subject: [PATCH 2/6] remove dry run --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 27f183d..4589b76 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -98,4 +98,4 @@ jobs: 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 --access public --dry-run + npm publish ./target/npm-build --access public From eec4c0e4ba111e3d040421deeb38da6b47d91ff6 Mon Sep 17 00:00:00 2001 From: jem Date: Mon, 13 Jul 2020 18:37:05 +0200 Subject: [PATCH 3/6] add stable & unstable build options --- .github/workflows/{release.yml => stable.yml} | 0 .github/workflows/test-pr.yml | 42 ------------------- .github/workflows/unstable.yml | 26 ++++++++++++ 3 files changed, 26 insertions(+), 42 deletions(-) rename .github/workflows/{release.yml => stable.yml} (100%) delete mode 100644 .github/workflows/test-pr.yml create mode 100644 .github/workflows/unstable.yml diff --git a/.github/workflows/release.yml b/.github/workflows/stable.yml similarity index 100% rename from .github/workflows/release.yml rename to .github/workflows/stable.yml diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml deleted file mode 100644 index 44febd0..0000000 --- a/.github/workflows/test-pr.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: test PR - -on: - pull_request: - branches: [ master ] - push: - ingnored-branches: [ 'master' ] - -jobs: - test-matrix: - name: matrix test - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [10.x, 12.x, 14.x] - - steps: - - uses: actions/checkout@v2 - - - name: Cache node modules - uses: actions/cache@v2 - env: - cache-name: cache-node-modules - with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: /usr/lib/node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - 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 diff --git a/.github/workflows/unstable.yml b/.github/workflows/unstable.yml new file mode 100644 index 0000000..e053fd4 --- /dev/null +++ b/.github/workflows/unstable.yml @@ -0,0 +1,26 @@ +name: unstable +on: + push: + tags: '![0-9]+.[0-9]+.[0-9]+*' + +jobs: + unstable: + name: unstable + 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 From 5220d13ea1a3a28baa601a6b1b28f837c8853645 Mon Sep 17 00:00:00 2001 From: jem Date: Mon, 13 Jul 2020 18:48:39 +0200 Subject: [PATCH 4/6] unstable only works with tags atmo --- .github/workflows/unstable.yml | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .github/workflows/unstable.yml diff --git a/.github/workflows/unstable.yml b/.github/workflows/unstable.yml deleted file mode 100644 index e053fd4..0000000 --- a/.github/workflows/unstable.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: unstable -on: - push: - tags: '![0-9]+.[0-9]+.[0-9]+*' - -jobs: - unstable: - name: unstable - 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 From 926d25c0639209b1d806aab3c5d40a756c77230a Mon Sep 17 00:00:00 2001 From: jem Date: Mon, 13 Jul 2020 18:53:15 +0200 Subject: [PATCH 5/6] adjust RELEASE description --- RELEASING.md | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/RELEASING.md b/RELEASING.md index 2b77be3..7ade9b0 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -2,44 +2,36 @@ ## dev release ``` +# run the tests shadow-cljs compile test +# release the app shadow-cljs release app chmod a+x mastodon-bot.js -rm -rf target/npm-build -mkdir target/npm-build -cp mastodon-bot.js target/npm-build -cp package.json target/npm-build -cp README.md target/npm-build +# publish to npm +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 --access public ``` -## prod release (should be done from master) +## stable release (should be done from master) ``` shadow-cljs compile test -#adjust version -vi shadow-cljs.edn +#adjust [version] +vi package.json git commit -am "releasing" -git tag [version] -git push && git push --tag +git commit -am [version] +git push --follow-tags -shadow-cljs release app - -shadow-cljs release app -chmod a+x mastodon-bot.js -rm -rf target/npm-build -mkdir target/npm-build -cp mastodon-bot.js target/npm-build -cp package.json target/npm-build -cp README.md target/npm-build - -npm publish ./target/npm-build --access public - -# Bump version -vi shadow-cljs.edn +# Bump [version] +vi package.json git commit -am "version bump" && git push ``` From 9c29c13a847bd9382d44026a43f6f1448ed52844 Mon Sep 17 00:00:00 2001 From: jem Date: Mon, 13 Jul 2020 18:54:27 +0200 Subject: [PATCH 6/6] we should use more advanced optimazation for release --- shadow-cljs.edn | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shadow-cljs.edn b/shadow-cljs.edn index a823f03..329d458 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -8,5 +8,4 @@ :repl-pprint true} :app {:target :node-script :output-to "mastodon-bot.js" - :main mastodon-bot.core/main - :compiler-options {:optimizations :simple}}}} + :main mastodon-bot.core/main}}}