Skip to content

Commit 67fde2d

Browse files
committed
Update publish.yml
1 parent e7dda1a commit 67fde2d

1 file changed

Lines changed: 58 additions & 56 deletions

File tree

.github/workflows/publish.yml

Lines changed: 58 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,65 @@
11
name: Build plugin
22

33
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
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
88

99
env:
10-
PLUGIN_NAME: logseq-plugin-automatic-url-title
10+
PLUGIN_NAME: ${{ github.event.repository.name }}
1111

1212
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: '16'
22-
- name: Build
23-
id: build
24-
run: |
25-
npm ci && npm run build
26-
mkdir ${{ env.PLUGIN_NAME }}
27-
cp README.md package.json icon.png ${{ env.PLUGIN_NAME }}
28-
mv dist ${{ env.PLUGIN_NAME }}
29-
zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }}
30-
ls
31-
echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)"
32-
- name: Create Release
33-
uses: ncipollo/release-action@v1
34-
id: create_release
35-
env:
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37-
VERSION: ${{ github.ref }}
38-
with:
39-
allowUpdates: true
40-
draft: false
41-
prerelease: false
42-
43-
- name: Upload zip file
44-
id: upload_zip
45-
uses: actions/upload-release-asset@v1
46-
env:
47-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48-
with:
49-
upload_url: ${{ steps.create_release.outputs.upload_url }}
50-
asset_path: ./${{ env.PLUGIN_NAME }}.zip
51-
asset_name: ${{ env.PLUGIN_NAME }}-${{ steps.build.outputs.tag_name }}.zip
52-
asset_content_type: application/zip
53-
54-
- name: Upload package.json
55-
id: upload_metadata
56-
uses: actions/upload-release-asset@v1
57-
env:
58-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59-
with:
60-
upload_url: ${{ steps.create_release.outputs.upload_url }}
61-
asset_path: ./package.json
62-
asset_name: package.json
63-
asset_content_type: application/json
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- name: Use Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '20'
23+
24+
- name: Build
25+
id: build
26+
run: |
27+
npm ci && npm run build
28+
mkdir ${{ env.PLUGIN_NAME }}
29+
cp README.md package.json icon.png ${{ 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)