Skip to content

Merge pull request #60 from monnierant/dev #25

Merge pull request #60 from monnierant/dev

Merge pull request #60 from monnierant/dev #25

Workflow file for this run

name: Release Obsidian plugin
on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.1.0
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"
- name: Extract tag name
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Create annotation for build error
run: |
sed -i 's/"version": .*/"version": "${{ env.TAG_NAME }}",/' manifest.json;
sed -i 's/"version": .*/"version": "${{ env.TAG_NAME }}",/' package.json;
- name: Build plugin
run: |
npm install
npm run build
- name: Push Version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag="${GITHUB_REF#refs/tags/}"
git config --global user.email "semantic@release.com"
git config --global user.name "Semantic Release"
git add manifest.json
git add package.json
git commit -m "Bump version to $tag [skip ci]"
git push
gh pr create \
--title "Bump version to $tag" \
--body "Bump version to $tag" \
--base dev --head $GITHUB_REPOSITORY:$GITHUB_REF
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag="${GITHUB_REF#refs/tags/}"
gh release create "$tag" \
--title="$tag" \
--draft \
main.js manifest.json styles.css