Update and rename create-release-for-fv.yaml to build-and-push.yml

This commit is contained in:
Lost Paul 2025-02-24 08:23:28 +01:00 committed by GitHub
parent 086c791a82
commit 7903068cc6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,9 +1,6 @@
name: Build and Push to Folder Overview
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
inputs:
tag:
@ -17,25 +14,17 @@ jobs:
- name: Checkout folder-notes
uses: actions/checkout@v3
with:
repository: LostPaul/obsidian-folder-notes
fetch-depth: 0
submodules: recursive
path: folder-notes
- name: Install dependencies
run: |
cd folder-notes
npm install
run: npm install
- name: Build folder-overview
run: |
cd folder-notes
npm run fv-build # This will run esbuild.config.mjs
run: npm run fv-build
- name: Verify build output
run: |
ls -la folder-notes/src/obsidian-folder-overview/
ls -la folder-notes/dist/
ls -la src/obsidian-folder-overview/
- name: Checkout folder-overview
uses: actions/checkout@v3
@ -47,8 +36,8 @@ jobs:
- name: Copy built files to folder-overview
run: |
cp folder-notes/src/obsidian-folder-overview/main.js \
folder-notes/src/obsidian-folder-overview/styles.css folder-overview/
cp src/obsidian-folder-overview/main.js \
src/obsidian-folder-overview/styles.css folder-overview/
- name: Commit and push built files
run: |
@ -62,3 +51,10 @@ jobs:
git commit -m "Add built files for release"
git push origin main
fi
- name: Trigger release on folder-overview
run: |
curl -X POST -H "Authorization: token ${{ secrets.PAT }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/LostPaul/obsidian-folder-overview/actions/workflows/release.yml/dispatches \
-d '{"ref": "main", "inputs": {"tag": "${{ github.event.inputs.tag }}"}}'