mirror of
https://github.com/lostpaul/obsidian-folder-notes.git
synced 2026-07-22 07:40:24 +00:00
51 lines
No EOL
1.4 KiB
YAML
51 lines
No EOL
1.4 KiB
YAML
# https://github.com/SilentVoid13/Templater/blob/master/.github/workflows/release.yml
|
|
name: Plugin release
|
|
on:
|
|
push:
|
|
tags:
|
|
- "[0-9]+.[0-9]+.[0-9]+"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Fetch main branch
|
|
run: git fetch origin main
|
|
|
|
- name: Checkout main branch
|
|
run: git checkout main
|
|
|
|
- name: Extract version from tag
|
|
id: extract_version
|
|
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
|
|
|
- name: Update manifest.json
|
|
run: |
|
|
VERSION=${{ env.VERSION }}
|
|
jq --arg version "$VERSION" '.version = $version' manifest.json > manifest-temp.json
|
|
mv manifest-temp.json manifest.json
|
|
|
|
- name: Commit and push changes
|
|
run: |
|
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
git config --local user.name "github-actions[bot]"
|
|
git add manifest.json
|
|
git commit -m "Update manifest.json to version $VERSION"
|
|
git push origin main
|
|
|
|
- name: npm build
|
|
run: |
|
|
npm install
|
|
npm run build --if-present
|
|
|
|
- name: Create Plugin release
|
|
uses: ncipollo/release-action@v1.12.0
|
|
with:
|
|
artifacts: "main.js,manifest.json,styles.css"
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
tag: ${{ github.ref_name }} |