Skip to content

Merge pull request #40 from karlsbeard/feat-example #21

Merge pull request #40 from karlsbeard/feat-example

Merge pull request #40 from karlsbeard/feat-example #21

Workflow file for this run

name: Release Obsidian plugin
on:
push:
tags:
- "*"
env:
PLUGIN_NAME: obsidian-univer
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "16.x "
- name: Build
id: build
run: |
npm install
npm run build
mkdir ${{ env.PLUGIN_NAME }}
echo "Waiting for build files..."
while [ ! -f dist/main.js ] || [ ! -f dist/manifest.json ] || [ ! -f dist/styles.css ]; do
echo "Still waiting for build files..."
sleep 1
done
echo "All build files are ready."
- name: Get latest release upload URL
id: get_latest_release
run: |
upload_url=$(gh release view --json uploadUrl -q .uploadUrl)
echo "::set-output name=upload_url::$upload_url"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload main.js
id: upload-main
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_latest_release.outputs.upload_url }}
asset_path: ./dist/main.js
asset_name: main.js
asset_content_type: text/javascript
- name: Upload manifest.json
id: upload-manifest
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_latest_release.outputs.upload_url }}
asset_path: ./dist/manifest.json
asset_name: manifest.json
asset_content_type: application/json
- name: Upload styles.css
id: upload-css
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_latest_release.outputs.upload_url }}
asset_path: ./dist/styles.css
asset_name: styles.css
asset_content_type: text/css