Skip to content

Commit 461f281

Browse files
committed
updated release config
1 parent f901a23 commit 461f281

1 file changed

Lines changed: 21 additions & 51 deletions

File tree

.github/workflows/main.yml

Lines changed: 21 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,68 +5,38 @@ on:
55
tags:
66
- "v*"
77

8+
permissions:
9+
contents: write
10+
811
env:
912
PLUGIN_NAME: logseq-night-owl-theme
1013

1114
jobs:
12-
build:
15+
release:
1316
runs-on: ubuntu-latest
14-
1517
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v4
18+
- uses: actions/checkout@v4
1819

19-
- name: Use Node
20-
uses: actions/setup-node@v4
20+
- uses: actions/setup-node@v4
2121
with:
22-
node-version: "20"
23-
24-
- name: Install dependencies
25-
run: npm ci
22+
node-version: 20
23+
cache: 'npm'
2624

27-
- name: Build CSS
28-
run: npm run build
29-
30-
- name: Prepare plugin folder
31-
run: |
32-
mkdir $PLUGIN_NAME
33-
cp custom.css $PLUGIN_NAME/
34-
cp package.json $PLUGIN_NAME/
35-
cp icon.png $PLUGIN_NAME/ || true
25+
- run: npm ci
26+
- run: npm run build
3627

37-
- name: Zip plugin
38-
id: build
28+
- name: Package plugin
3929
run: |
40-
zip -r $PLUGIN_NAME.zip $PLUGIN_NAME
41-
echo "tag_name=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
30+
mkdir ${{ env.PLUGIN_NAME }}
31+
cp custom.css ${{ env.PLUGIN_NAME }}/
32+
cp package.json ${{ env.PLUGIN_NAME }}/
33+
cp icon.png ${{ env.PLUGIN_NAME }} || true
34+
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
4235
43-
- name: Create or update release
44-
id: create_release
45-
uses: ncipollo/release-action@v1
36+
- uses: softprops/action-gh-release@v2
4637
with:
47-
token: ${{ secrets.GITHUB_TOKEN }}
48-
tag: ${{ steps.build.outputs.tag_name }}
49-
allowUpdates: true
38+
files: |
39+
${{ env.PLUGIN_NAME }}.zip
40+
package.json
41+
generate_release_notes: true
5042
draft: false
51-
prerelease: false
52-
53-
- name: Upload zip file
54-
id: upload_zip
55-
uses: actions/upload-release-asset@v1
56-
env:
57-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58-
with:
59-
upload_url: ${{ steps.create_release.outputs.upload_url }}
60-
asset_path: ./${{ env.PLUGIN_NAME }}.zip
61-
asset_name: ${{ env.PLUGIN_NAME }}-${{ steps.build.outputs.tag_name }}.zip
62-
asset_content_type: application/zip
63-
64-
65-
- name: Upload package.json asset
66-
uses: actions/upload-release-asset@v1
67-
with:
68-
upload_url: ${{ steps.create_release.outputs.upload_url }}
69-
asset_path: ./package.json
70-
asset_name: package.json
71-
asset_content_type: application/json
72-
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)