Skip to content

Ensure recurrent flag is set correctly #82

Ensure recurrent flag is set correctly

Ensure recurrent flag is set correctly #82

Workflow file for this run

name: Build obsidian plugin
on:
pull_request:
branches:
- master
types:
- closed # Trigger only when a PR is closed (merged)
env:
PLUGIN_NAME: obsidian-ics
jobs:
build:
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/')
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm install
- name: Create and push a tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=$(jq -r .version package.json)
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "$VERSION"
git push origin "$VERSION"
- name: Build
run: |
npm run build --if-present
mkdir ${{ env.PLUGIN_NAME }}
cp manifest.json dist/
cp styles.css dist/
cp dist/main.js dist/manifest.json ${{ env.PLUGIN_NAME }}
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
ls dist/
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=$(jq -r .version package.json)
gh release create "$VERSION" \
--draft \
--title="$VERSION" \
--notes "Automated release for version $VERSION" \
dist/main.js dist/styles.css dist/manifest.json ${{ env.PLUGIN_NAME }}.zip