Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dale0525 committed Dec 25, 2023
1 parent d3da5bb commit 123eed3
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release Workflow

on:
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install Dependencies
run: npm install -g pnpm && pnpm install && pnpm run build

- name: Get Current Version
id: version
run: echo "::set-output name=version::$(node -p "require('./package.json').version")"

- name: Check for Existing Release
id: check_release
run: |
current_version="${{ steps.version.outputs.version }}"
if git rev-parse -q --verify "refs/tags/v$current_version"; then
echo "Release $current_version already exists. Nothing to do."
exit 0
fi
echo "No release found for version $current_version."
- name: Create Release
if: steps.check_release.outputs.result == 'failure'
id: create_release
run: |
current_version="${{ steps.version.outputs.version }}"
commit_message=$(git log -1 --pretty=%B)
release_title="v$current_version"
echo "Creating release $release_title"
release_id=$(curl -s -X POST -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" -d "{\"tag_name\": \"$release_title\", \"name\": \"$release_title\", \"body\": \"$commit_message\"}" "https://api.github.com/repos/${{ github.repository }}/releases" | jq -r '.id')
echo "::set-output name=release_id::$release_id"
- name: Upload Release Binary
if: steps.create_release.outputs.release_id
run: |
release_id="${{ steps.create_release.outputs.release_id }}"
zip_path="${{ steps.zip_package.outputs.zip_path }}"
echo "Uploading binary to release $release_id"
curl -s -X POST -H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" -H "Content-Type: application/zip" --data-binary "@$zip_path" "https://uploads.github.com/repos/${{ github.repository }}/releases/$release_id/assets?name=package.zip"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "siyuan-auto-seq-number",
"version": "0.2.0",
"version": "0.2.1",
"description": "A SiYuan Plugin to auto generate sequence number for titles",
"main": ".src/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "siyuan-auto-seq-number",
"author": "Logic Tan",
"url": "https://github.com/dale0525/siyuan-auto-seq-number",
"version": "0.2.0",
"version": "0.2.1",
"minAppVersion": "2.11.1",
"backends": [
"all"
Expand Down

0 comments on commit 123eed3

Please sign in to comment.