From cfa45ec12fffc5a33f059a4249dbc05618509c38 Mon Sep 17 00:00:00 2001
From: Andrew Malikov
Date: Sat, 19 Nov 2022 22:21:15 +0400
Subject: [PATCH] add the release action and cleanup missconfigured ones
---
.editorconfig | 25 +++++++++++--------
.github/workflows/ci.yml | 46 +++++++++++++++++------------------
.github/workflows/release.yml | 46 +++++++++++++++++++++++++++++++++++
README.md | 12 ++-------
styles.css | 0
versions.json | 2 --
6 files changed, 86 insertions(+), 45 deletions(-)
create mode 100644 .github/workflows/release.yml
delete mode 100644 styles.css
diff --git a/.editorconfig b/.editorconfig
index 84b8a66..715b66a 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,10 +1,15 @@
-# top-most EditorConfig file
-root = true
-
-[*]
-charset = utf-8
-end_of_line = lf
-insert_final_newline = true
-indent_style = tab
-indent_size = 4
-tab_width = 4
+# top-most EditorConfig file
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+indent_style = tab
+indent_size = 4
+tab_width = 4
+
+[*.yml]
+indent_style = space
+indent_size = 2
+tab_width = 2
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 6b859d0..cb40f89 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,34 +1,34 @@
name: CI
on:
- push:
- branches: [master]
- pull_request:
- branches: [master]
+ push:
+ branches: [master]
+ pull_request:
+ branches: [master]
jobs:
- build:
- runs-on: ubuntu-latest
+ build:
+ runs-on: ubuntu-latest
- strategy:
- matrix:
- node-version: [18.x]
+ strategy:
+ matrix:
+ node-version: [18.x]
- steps:
- - uses: actions/checkout@v3
+ steps:
+ - uses: actions/checkout@v3
- - name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v3
- with:
- node-version: ${{ matrix.node-version }}
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v3
+ with:
+ node-version: ${{ matrix.node-version }}
- - name: Setup pnpm
- uses: pnpm/action-setup@v2.2.4
- with:
- version: latest
+ - name: Setup pnpm
+ uses: pnpm/action-setup@v2.2.4
+ with:
+ version: latest
- - name: Install dependencies
- run: pnpm install
+ - name: Install dependencies
+ run: pnpm install
- - name: Build
- run: pnpm build
+ - name: Build
+ run: pnpm build
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..e2ed28a
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,46 @@
+name: Release
+
+on:
+ push:
+ tags:
+ - "*"
+
+jobs:
+ tagged-release:
+ name: "Tagged Release"
+ runs-on: "ubuntu-latest"
+
+ strategy:
+ matrix:
+ node-version: [18.x]
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v3
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ - name: Setup pnpm
+ uses: pnpm/action-setup@v2.2.4
+ with:
+ version: latest
+
+ - name: Install dependencies
+ run: pnpm install
+
+ - name: Ensure version
+ run: pnpm version
+
+ - name: Build
+ run: pnpm build
+
+ - name: Create a release
+ uses: "marvinpinto/action-automatic-releases@latest"
+ with:
+ repo_token: "${{ secrets.GITHUB_TOKEN }}"
+ prerelease: false
+ files: |
+ ./main.js
+ ./manifest.json
diff --git a/README.md b/README.md
index 755b3eb..8bdb399 100644
--- a/README.md
+++ b/README.md
@@ -18,14 +18,6 @@ Replaces the default [Obsidian](https://obsidian.md/) caret with a smooth and ro
-
-
-Dark | Light
-----------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------
- |
-
-
-
## Features
- Smooth caret which stops blinking after 20 iterations.
@@ -33,14 +25,14 @@ Dark
## Related
-- Based on the default selection [extension](https://github.com/codemirror/view/blob/main/src/draw-selection.ts). The actual code is a bit transformed into functional style while cursor is fully based on Obsidian's one.
+- Based on the default selection [extension](https://github.com/codemirror/view/blob/main/src/draw-selection.ts). The actual code is a bit transformed into a functional style while the cursor is fully based on Obsidian's one.
- [The blink animation](https://easings.net/#easeInOutCirc).
## Releasing new releases
- Update your `manifest.json` with your new version number, such as `1.0.1`, and the minimum Obsidian version required for your latest release.
- Update your `versions.json` file with `"new-plugin-version": "minimum-obsidian-version"` so older versions of Obsidian can download an older version of your plugin that's compatible.
-- Create new GitHub release using your new version number as the "Tag version". Use the exact version number, don't include a prefix `v`. See here for an example:
+Create a new GitHub release using your new version number as the "Tag version". Use the exact version number, don't include a prefix `v`. See here for an example:
- Upload the files `manifest.json`, `main.js`, `styles.css` as binary attachments. Note: The manifest.json file must be in two places, first the root path of your repository and also in the release.
- Publish the release.
diff --git a/styles.css b/styles.css
deleted file mode 100644
index e69de29..0000000
diff --git a/versions.json b/versions.json
index e04a363..8312519 100644
--- a/versions.json
+++ b/versions.json
@@ -1,5 +1,3 @@
{
- "1.0.0": "1.0.0",
- "1.0.1": "1.0.1",
"1.1.0": "1.0.1"
}