Release #4
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 | |
| env: | |
| PLUGIN_NAME: indexable-folders | |
| PLUGIN_VERSION: ${GITHUB_REF#refs/tags/} | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build plugin | |
| run: pnpm build | |
| - name: Create zip archive | |
| run: | | |
| mkdir ${{ env.PLUGIN_NAME }} | |
| cp main.js manifest.json styles.css ${{ env.PLUGIN_NAME }} | |
| zip -r -9 ${{ env.PLUGIN_NAME }}-${{ env.PLUGIN_VERSION }}.zip ${{ env.PLUGIN_NAME }} | |
| - name: Create release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release create "${{ env.PLUGIN_VERSION }}" \ | |
| --title="${{ env.PLUGIN_VERSION }}" \ | |
| --draft \ | |
| main.js manifest.json styles.css ${{ env.PLUGIN_NAME }}-${{ env.PLUGIN_VERSION }}.zip | |
| # Optional: Auto-update release notes | |
| update-release-notes: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: success() | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Generate release notes | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| tag="${GITHUB_REF#refs/tags/}" | |
| # Get previous tag | |
| previous_tag=$(git describe --tags --abbrev=0 "$tag^" 2>/dev/null || echo "") | |
| # Generate release notes | |
| if [ -n "$previous_tag" ]; then | |
| echo "## What's Changed" > release_notes.md | |
| echo "" >> release_notes.md | |
| git log --pretty=format:"- %s" "$previous_tag..$tag" >> release_notes.md | |
| else | |
| echo "## Initial Release" > release_notes.md | |
| echo "" >> release_notes.md | |
| echo "First release of the Indexable Folders plugin for Obsidian." >> release_notes.md | |
| fi | |
| # Update release with notes | |
| gh release edit "$tag" --notes-file release_notes.md |