Skip to content

Commit

Permalink
Set up publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickDeVries committed Nov 16, 2023
1 parent 46a39c8 commit a09acb9
Show file tree
Hide file tree
Showing 6 changed files with 3,074 additions and 73 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Publish Plugin

on:
workflow_dispatch:
push:
tags:
- "*"

env:
PLUGIN_NAME: logseq-plugin-colored-threads

jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: Run install
uses: borales/[email protected]
with:
cmd: install # will run `yarn install` command

- name: Build package bundle
uses: borales/[email protected]
with:
cmd: build # will run `yarn build` command

- name: Zip build
id: zip
run: |
mv dist ${{ env.PLUGIN_NAME }}
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
tar -cvzf ${{ env.PLUGIN_NAME }}.tgz ${{ env.PLUGIN_NAME }}
ls
echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)"
- name: Create Release
uses: ncipollo/release-action@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ github.ref }}
with:
allowUpdates: true
draft: false
prerelease: false

- name: Upload zip file
id: upload_zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.PLUGIN_NAME }}.zip
asset_name: ${{ env.PLUGIN_NAME }}-${{ github.ref }}.zip
asset_content_type: application/zip

- name: Upload package.json
id: upload_metadata
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./package.json
asset_name: package.json
asset_content_type: application/json
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.16.0
20.6.1
5 changes: 5 additions & 0 deletions .releaserc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
release: {
branches: ['main'],
},
}
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 20.6.1
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "logseq-plugin-colored-threads",
"version": "0.0.1",
"version": "0.0.0-development",
"description": "A plugin for coloring threads",
"author": "PatrickDeVries",
"license": "MIT",
Expand All @@ -12,7 +12,8 @@
"lint:format": "prettier --check .",
"lint:code": "eslint . --max-warnings=0",
"lint:types": "tsc --noEmit",
"lint:all": "concurrently -g -c auto -n \"format,code,types\" \"yarn lint:format\" \"yarn lint:code\" \"yarn lint:types\""
"lint:all": "concurrently -g -c auto -n \"format,code,types\" \"yarn lint:format\" \"yarn lint:code\" \"yarn lint:types\"",
"semantic-release": "semantic-release --branches main"
},
"dependencies": {
"@logseq/libs": "^0.0.15"
Expand All @@ -26,6 +27,7 @@
"eslint-plugin-import": "^2.29.0",
"prettier": "^3.1.0",
"process": "^0.11.10",
"semantic-release": "^22.0.7",
"typescript": "5.2.2",
"vite": "^4.5.0",
"vite-plugin-logseq": "^1.1.2"
Expand All @@ -34,5 +36,9 @@
"icon": "./src/logo.svg",
"id": "_patrickdevries-logseq-plugin-colored-threads"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"repository": {
"type": "git",
"url": "https://github.com/PatrickDeVries/logseq-plugin-colored-threads.git"
}
}
Loading

0 comments on commit a09acb9

Please sign in to comment.