mirror of
https://github.com/forketyfork/obsidian-youtrack-fetcher.git
synced 2026-07-22 12:30:26 +00:00
44 lines
1.3 KiB
YAML
44 lines
1.3 KiB
YAML
name: Release Obsidian plugin
|
|
on:
|
|
push:
|
|
tags:
|
|
- "*"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: "18.x"
|
|
- name: Build plugin
|
|
run: |
|
|
yarn install
|
|
yarn build
|
|
- name: Fail if build modified files
|
|
run: |
|
|
if [ -n "$(git status --porcelain)" ]; then
|
|
echo "Build modified files. Commit the output of 'yarn build'."
|
|
git status --porcelain
|
|
exit 1
|
|
fi
|
|
- name: Create plugin archives
|
|
run: |
|
|
mkdir -p obsidian-youtrack-fetcher
|
|
cp main.js manifest.json styles.css obsidian-youtrack-fetcher/
|
|
zip -r obsidian-youtrack-fetcher.zip obsidian-youtrack-fetcher/
|
|
tar -czf obsidian-youtrack-fetcher.tar.gz obsidian-youtrack-fetcher/
|
|
- 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 obsidian-youtrack-fetcher.zip obsidian-youtrack-fetcher.tar.gz
|