chore(release): release v1.0.2 #30
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Obsidian plugin | |
on: | |
push: | |
tags: | |
- '*' | |
env: | |
PLUGIN_NAME: obsidian-univer | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
registry-url: ${{ secrets.VERDACCIO_URL }} | |
scope: '@univerjs-pro' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.VERDACCIO_TOKEN }} | |
- name: Build | |
id: build | |
run: | | |
pnpm i | |
pnpm 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 |