diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c00a4c4..ff28af3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release plugin +name: Release on: push: @@ -9,11 +9,66 @@ env: PLUGIN_NAME: oencrypt jobs: + update_version: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Update versions.json + run: | + TAG_NAME=${{ github.ref }} + TAG_NAME=${TAG_NAME#refs/tags/} + if ! grep -q "\"$TAG_NAME\":" versions.json; then + LAST_VERSION=$(jq 'keys | .[-1]' versions.json) + jq --arg tag "$TAG_NAME" --arg last "$LAST_VERSION" '.[$tag] = $last' versions.json > tmp.json && mv tmp.json versions.json + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add versions.json + git commit -m "Update versions.json for $TAG_NAME" + fi + + - name: Update package.json + run: | + TAG_NAME=${{ github.ref }} + TAG_NAME=${TAG_NAME#refs/tags/} + CURRENT_VERSION=$(jq -r '.version' package.json) + if [ "$CURRENT_VERSION" != "$TAG_NAME" ]; then + jq --arg tag "$TAG_NAME" '.version = $tag' package.json > tmp.json && mv tmp.json package.json + git add package.json + git commit -m "Update package.json version to $TAG_NAME" + fi + + - name: Update manifest.json + run: | + TAG_NAME=${{ github.ref }} + TAG_NAME=${TAG_NAME#refs/tags/} + CURRENT_VERSION=$(jq -r '.version' manifest.json) + if [ "$CURRENT_VERSION" != "$TAG_NAME" ]; then + jq --arg tag "$TAG_NAME" '.version = $tag' manifest.json > tmp.json && mv tmp.json manifest.json + git add manifest.json + git commit -m "Update manifest.json version to $TAG_NAME" + fi + + - name: Push changes + run: | + git push origin HEAD:master + build: runs-on: ubuntu-latest + needs: update_version steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Use Node.js uses: actions/setup-node@v3 with: @@ -28,6 +83,7 @@ jobs: mkdir dist cp ./main.js ./manifest.json dist cp ./main.js ./manifest.json ${{ env.PLUGIN_NAME }} + cp ./assets/styles.css ./assets/styles.css ${{ env.PLUGIN_NAME }} zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }} ls echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)" @@ -66,7 +122,7 @@ jobs: asset_name: main.js asset_content_type: text/javascript - - name: Upload custom.css + - name: Upload styles.css id: upload-css uses: actions/upload-release-asset@v1 env: diff --git a/manifest.json b/manifest.json index 991c747..16ae83b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "oencrypt", "name": "OEncrypt", - "version": "1.0.0", + "version": "1.0.1", "minAppVersion": "0.15.0", "description": "A plugin for Obsidian that encrypts and decrypts notes using PGP, ensuring the security of your sensitive information.", "author": "Xezard", diff --git a/package.json b/package.json index 2e0b555..b5e9751 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "oencrypt", - "version": "1.0.0", + "version": "1.0.1", "description": "A plugin for Obsidian that encrypts and decrypts notes using PGP, ensuring the security of your sensitive information.", "main": "main.js", "scripts": { @@ -8,9 +8,17 @@ "build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production", "version": "node version-bump.mjs && git add manifest.json versions.json" }, - "keywords": [], - "author": "", - "license": "MIT", + "keywords": [ + "obsidian", + "plugin", + "pgp", + "encryption", + "cipher", + "password", + "security" + ], + "author": "Xezard", + "license": "GPL-3.0", "devDependencies": { "@types/node": "^16.11.6", "@types/pako": "^2.0.3", diff --git a/versions.json b/versions.json index 5842672..a6d5a03 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,4 @@ { - "1.0.0": "0.15.0" + "1.0.0": "0.15.0", + "1.0.1": "0.15.0" } \ No newline at end of file