Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.

Commit 96af759

Browse files
author
Sujaykumar Hublikar
committed
Update workflows
1 parent a7069df commit 96af759

File tree

2 files changed

+76
-35
lines changed

2 files changed

+76
-35
lines changed

.github/workflows/codeql.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# CodeQL
2+
# .github/workflows/codeql.yml
3+
name: "CodeQL"
4+
5+
on:
6+
push:
7+
branches: [ main ]
8+
pull_request:
9+
# The branches below must be a subset of the branches above
10+
branches: [ main ]
11+
12+
jobs:
13+
analyze:
14+
name: Analyze
15+
runs-on: ubuntu-latest
16+
permissions:
17+
actions: read
18+
contents: read
19+
security-events: write
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
language: [ 'javascript' ]
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v2
29+
30+
# Initializes the CodeQL tools for scanning.
31+
- name: Initialize CodeQL
32+
uses: github/codeql-action/init@v1
33+
with:
34+
languages: ${{ matrix.language }}
35+
36+
- name: Autobuild
37+
uses: github/codeql-action/autobuild@v1
38+
39+
- name: Perform CodeQL Analysis
40+
uses: github/codeql-action/analyze@v1

.github/workflows/publish.yml

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
# Publish resources
2-
name: "🚀 publish"
1+
# Build and Publish resources
2+
# .github/workflows/publish.yml
3+
name: "Build & Publish package"
34

45
on:
5-
push:
6-
# branches:
7-
# - main
8-
tags:
9-
- "v*"
10-
paths:
11-
- 'package.json'
12-
- 'package-lock.json'
13-
- 'src'
6+
release:
7+
types: [created]
148

159
jobs:
1610

@@ -36,49 +30,56 @@ jobs:
3630
# Install npm packages
3731
- run: npm install
3832

39-
# dist setup
40-
- run: rm -rf dist/.git* # delete .git* files
33+
# Setup env
4134
- run: echo ${{ env.RELEASE_VERSION }} >> Release.txt
42-
- run: mv LICENSE LICENSE.txt
4335
- run: sed -i -e 's/REL_VER_NUMBER/${{ env.RELEASE_VERSION }}/g' src/plugin.js
4436

45-
# Build dist
46-
- run: npm run all
37+
# dist setup
38+
- run: rm -rf dist/.git* # delete .git* files in dist
39+
- run: echo ARCHIVE="docsify-plugin-title-${{ env.RELEASE_VERSION }}.zip" >> $GITHUB_ENV
40+
- run: mv LICENSE LICENSE.txt
41+
42+
# Build for dist
43+
- run: npm run minify
4744

4845
# Publish to npm
49-
- name: "📦 publish to npm"
46+
- name: "🚀 Publish to npm"
5047
uses: JS-DevTools/npm-publish@v1
5148
with:
5249
token: ${{ secrets.NPM_TOKEN }}
5350
access: "public"
5451
check-version: true
5552

5653
# Publish to github npm
57-
- name: "📦 publish to github npm"
54+
- name: "🚀 Publish to github npm"
5855
uses: JS-DevTools/npm-publish@v1
5956
with:
6057
token: ${{ secrets.GITHUB_TOKEN }}
6158
access: "public"
6259
registry: "https://npm.pkg.github.com"
6360
check-version: true
6461

65-
# publish release
66-
- uses: papeloto/action-zip@v1
67-
with:
68-
files: dist/plugin.js dist/plugin.min.js src/plugin.js package.json README.md LICENSE.txt
69-
recursive: false
70-
dest: dist.zip
71-
- run: sha256sum dist.zip >> dist.zip.sha256
72-
- run: md5sum dist.zip >> dist.zip.md5
73-
74-
- name: "📦 Github Release"
75-
uses: "marvinpinto/action-automatic-releases@latest"
76-
if: startsWith(github.ref, 'refs/tags/')
62+
# package for release
63+
- name: "📦 zipping files"
64+
run: |
65+
zip -r ${{ env.ARCHIVE }} ./src ./dist LICENSE* package* README.md
66+
67+
unzip -l ${{ env.ARCHIVE }}
68+
69+
- run: sha256sum ${{ env.ARCHIVE }} >> ${{ env.ARCHIVE }}.sha256
70+
- run: md5sum ${{ env.ARCHIVE }} >> ${{ env.ARCHIVE }}.md5
71+
72+
# Publish release
73+
- name: 🚀 Publish to Github Release
74+
uses: softprops/action-gh-release@v1
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7777
with:
78-
repo_token: "${{ secrets.GITHUB_TOKEN }}"
79-
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
8078
prerelease: false
79+
draft: false
80+
name: ${{ env.RELEASE_VERSION }}
81+
tag_name: ${{ env.RELEASE_VERSION }}
8182
files: |
82-
dist.zip
83-
dist.zip.sha256
84-
dist.zip.md5
83+
${{ env.ARCHIVE }}
84+
${{ env.ARCHIVE }}.sha256
85+
${{ env.ARCHIVE }}.md5

0 commit comments

Comments
 (0)