From 7292e2a3cce400c7a7970435b6df2c5c1c59212a Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Sun, 10 Apr 2022 17:38:33 +0200 Subject: [PATCH] Fixed release and publishing process --- .github/workflows/release.yml | 60 +++++++++++++++++------------------ assets/manifest.json | 10 ------ manifest.json | 10 ++++++ package.json | 2 +- version-bump.mjs | 18 +++++------ versions.json | 6 ++-- 6 files changed, 53 insertions(+), 53 deletions(-) delete mode 100644 assets/manifest.json create mode 100644 manifest.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7d6e196..2a84250 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,35 +58,35 @@ jobs: asset_name: ${{ env.PLUGIN_NAME }}-${{ steps.build.outputs.tag_name }}.zip asset_content_type: application/zip - # - name: Upload main.js - # id: upload-main - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.create_release.outputs.upload_url }} - # asset_path: ${{ env.DIST_FOLDER }}/main.js - # asset_name: main.js - # asset_content_type: text/javascript + - name: Upload main.js + id: upload-main + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ env.DIST_FOLDER }}/main.js + asset_name: main.js + asset_content_type: text/javascript - # - name: Upload manifest.json - # id: upload-manifest - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.create_release.outputs.upload_url }} - # asset_path: ${{ env.DIST_FOLDER }}/manifest.json - # asset_name: manifest.json - # asset_content_type: application/json + - name: Upload manifest.json + id: upload-manifest + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./manifest.json + asset_name: manifest.json + asset_content_type: application/json - # - name: Upload styles.css - # id: upload-css - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.create_release.outputs.upload_url }} - # asset_path: ${{ env.DIST_FOLDER }}/styles.css - # asset_name: styles.css - # asset_content_type: text/css \ No newline at end of file + - name: Upload styles.css + id: upload-css + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ${{ env.DIST_FOLDER }}/styles.css + asset_name: styles.css + asset_content_type: text/css \ No newline at end of file diff --git a/assets/manifest.json b/assets/manifest.json deleted file mode 100644 index 8ab630b..0000000 --- a/assets/manifest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id": "scambier.obsidian-omnisearch", - "name": "Omnisearch", - "version": "0.1.0", - "minAppVersion": "0.14.2", - "description": "Search over organization", - "author": "Simon Cambier", - "authorUrl": "", - "isDesktopOnly": false -} \ No newline at end of file diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..965f126 --- /dev/null +++ b/manifest.json @@ -0,0 +1,10 @@ +{ + "id": "scambier.obsidian-omnisearch", + "name": "Omnisearch", + "version": "0.1.1", + "minAppVersion": "0.14.2", + "description": "Search over organization", + "author": "Simon Cambier", + "authorUrl": "", + "isDesktopOnly": false +} \ No newline at end of file diff --git a/package.json b/package.json index c2ff8bd..250d7c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scambier.obsidian-search", - "version": "0.0.1", + "version": "0.1.1", "description": "Search over organization", "main": "dist/main.js", "scripts": { diff --git a/version-bump.mjs b/version-bump.mjs index d409fa0..3b46bd1 100644 --- a/version-bump.mjs +++ b/version-bump.mjs @@ -1,14 +1,14 @@ -import { readFileSync, writeFileSync } from "fs"; +import { readFileSync, writeFileSync } from 'fs' -const targetVersion = process.env.npm_package_version; +const targetVersion = process.env.npm_package_version // read minAppVersion from manifest.json and bump version to target version -let manifest = JSON.parse(readFileSync("manifest.json", "utf8")); -const { minAppVersion } = manifest; -manifest.version = targetVersion; -writeFileSync("manifest.json", JSON.stringify(manifest, null, "\t")); +const manifest = JSON.parse(readFileSync('manifest.json', 'utf8')) +const { minAppVersion } = manifest +manifest.version = targetVersion +writeFileSync('manifest.json', JSON.stringify(manifest, null, '\t')) // update versions.json with target version and minAppVersion from manifest.json -let versions = JSON.parse(readFileSync("versions.json", "utf8")); -versions[targetVersion] = minAppVersion; -writeFileSync("versions.json", JSON.stringify(versions, null, "\t")); +const versions = JSON.parse(readFileSync('versions.json', 'utf8')) +versions[targetVersion] = minAppVersion +writeFileSync('versions.json', JSON.stringify(versions, null, '\t')) diff --git a/versions.json b/versions.json index 997bf32..0af9a21 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,4 @@ { - "1.0.0": "0.9.7", - "1.0.1": "0.12.0" -} + "0.1.0": "0.14.2", + "0.1.1": "0.14.2" +} \ No newline at end of file