🔧 Remove old API files causing build failures #14
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Obsidian Plugin | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "*" | |
| env: | |
| PLUGIN_NAME: linian | |
| jobs: | |
| # Deploy to release branch on every push to main | |
| deploy-release-branch: | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "18" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build plugin | |
| run: npm run build | |
| - name: Create release folder structure | |
| run: | | |
| mkdir -p release-temp/${{ env.PLUGIN_NAME }} | |
| cp main.js manifest.json styles.css release-temp/${{ env.PLUGIN_NAME }}/ | |
| if [ -f "versions.json" ]; then | |
| cp versions.json release-temp/${{ env.PLUGIN_NAME }}/ | |
| fi | |
| - name: Deploy to release branch | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_branch: release | |
| publish_dir: ./release-temp | |
| force_orphan: true | |
| commit_message: "Deploy built plugin files for ${{ github.sha }}" | |
| # Create GitHub Release on tag push | |
| create-github-release: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "18" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build plugin | |
| run: npm run build | |
| - name: Create release assets | |
| run: | | |
| # Create zip with files directly in root (correct Obsidian plugin structure) | |
| zip ${{ env.PLUGIN_NAME }}-${{ github.ref_name }}.zip main.js manifest.json styles.css versions.json | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: "Linian v${{ github.ref_name }}" | |
| body: | | |
| ## Linian Obsidian Plugin v${{ github.ref_name }} | |
| ### Installation | |
| **Option 1: Download Plugin Folder (Recommended)** | |
| 1. Download `${{ env.PLUGIN_NAME }}-${{ github.ref_name }}.zip` | |
| 2. Extract the zip file | |
| 3. Copy the `${{ env.PLUGIN_NAME }}` folder to your vault's `.obsidian/plugins/` directory | |
| 4. Enable the plugin in Obsidian Settings → Community Plugins | |
| **Option 2: Manual Installation** | |
| 1. Download `main.js`, `manifest.json`, and `styles.css` | |
| 2. Create a folder named `${{ env.PLUGIN_NAME }}` in your vault's `.obsidian/plugins/` directory | |
| 3. Place the downloaded files in that folder | |
| 4. Enable the plugin in Obsidian Settings → Community Plugins | |
| draft: false | |
| prerelease: false | |
| files: | | |
| ${{ env.PLUGIN_NAME }}-${{ github.ref_name }}.zip | |
| main.js | |
| manifest.json | |
| styles.css | |
| versions.json |