mirror of
https://github.com/lostpaul/obsidian-folder-notes.git
synced 2026-07-22 07:40:24 +00:00
Merge branch 'main' of https://github.com/LostPaul/obsidian-folder-notes
This commit is contained in:
commit
e3e51062fa
1 changed files with 70 additions and 0 deletions
70
.github/workflows/create-release-for-fv.yaml
vendored
Normal file
70
.github/workflows/create-release-for-fv.yaml
vendored
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
name: Build and Push to Folder Overview
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "[0-9]+.[0-9]+.[0-9]+"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: "Tag to build"
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout folder-notes
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Use tag from input if triggered manually
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
|
||||
echo "GITHUB_REF=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Run fv-build
|
||||
run: |
|
||||
npm install
|
||||
npm run fv-build
|
||||
|
||||
- name: Checkout folder-overview repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: LostPaul/obsidian-folder-overview
|
||||
token: ${{ secrets.PAT }}
|
||||
path: folder-overview
|
||||
|
||||
- name: Initialize and update submodule for folder-overview
|
||||
run: |
|
||||
cd folder-overview
|
||||
git submodule update --init --recursive
|
||||
|
||||
- name: Copy built files from folder-notes to folder-overview
|
||||
run: |
|
||||
# Make sure the built files exist and copy them
|
||||
if [ -f "src/obsidian-folder-overview/main.js" ] && [ -f "src/obsidian-folder-overview/styles.css" ]; then
|
||||
cp src/obsidian-folder-overview/main.js src/obsidian-folder-overview/styles.css folder-overview/
|
||||
else
|
||||
echo "Built files not found, exiting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Commit and push built files to folder-overview
|
||||
run: |
|
||||
cd folder-overview
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git add -f main.js styles.css # Add the files inside folder-overview
|
||||
git commit -m "Add built files for release"
|
||||
git push origin main # Push to main branch or correct branch
|
||||
|
||||
- name: Trigger release workflow in 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.ref_name }}", "branch": "auto-build-${{ github.ref_name }}"}}'
|
||||
Loading…
Reference in a new issue