Skip to content

Commit ce35454

Browse files
committed
publish action.
1 parent d811b15 commit ce35454

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/publish.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Build plugin
2+
3+
on:
4+
push:
5+
# Sequence of patterns matched against refs/tags
6+
tags:
7+
- "*" # Push events to matching any tag format, i.e. 1.0, 20.15.10
8+
9+
env:
10+
PLUGIN_NAME: logseq-journals-calendar
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Use Node.js
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: "14.x" # You might need to adjust this value to your own version
22+
- name: Build
23+
id: build
24+
run: |
25+
npm install -g yarn
26+
yarn
27+
yarn build
28+
mkdir ${{ env.PLUGIN_NAME }}
29+
cp README.md package.json icon.png demo.gif ${{ env.PLUGIN_NAME }}
30+
mv dist ${{ env.PLUGIN_NAME }}
31+
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
32+
ls
33+
echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)"
34+
- name: Create Release
35+
uses: ncipollo/release-action@v1
36+
id: create_release
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
VERSION: ${{ github.ref }}
40+
with:
41+
allowUpdates: true
42+
draft: false
43+
prerelease: false
44+
45+
- name: Upload zip file
46+
id: upload_zip
47+
uses: actions/upload-release-asset@v1
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
upload_url: ${{ steps.create_release.outputs.upload_url }}
52+
asset_path: ./${{ env.PLUGIN_NAME }}.zip
53+
asset_name: ${{ env.PLUGIN_NAME }}-${{ steps.build.outputs.tag_name }}.zip
54+
asset_content_type: application/zip
55+
56+
- name: Upload package.json
57+
id: upload_metadata
58+
uses: actions/upload-release-asset@v1
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
with:
62+
upload_url: ${{ steps.create_release.outputs.upload_url }}
63+
asset_path: ./package.json
64+
asset_name: package.json
65+
asset_content_type: application/json

0 commit comments

Comments
 (0)