Skip to content

Commit 83d3ef4

Browse files
committed
Workflow adapted.
1 parent b938cda commit 83d3ef4

File tree

7 files changed

+23
-8
lines changed

7 files changed

+23
-8
lines changed

.github/workflows/CreateRelease.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v2
1515

16+
- name: Set up Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: "20.8.0"
20+
21+
- name: Install Dependencies
22+
run: npm install
23+
24+
- name: Build the Project
25+
run: tsc -noEmit -skipLibCheck && node esbuild.config.mjs production
26+
1627
- name: Get the version
1728
id: get_version
1829
run: echo "::set-output name=VERSION::$(jq -r .version manifest.json)"
@@ -45,7 +56,7 @@ jobs:
4556
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4657
with:
4758
upload_url: ${{ steps.create_release.outputs.upload_url }}
48-
asset_path: ./build/styles.css
59+
asset_path: ./src/styles.css
4960
asset_name: styles.css
5061
asset_content_type: text/css
5162

@@ -55,6 +66,6 @@ jobs:
5566
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5667
with:
5768
upload_url: ${{ steps.create_release.outputs.upload_url }}
58-
asset_path: ./build/manifest.json
69+
asset_path: ./manifest.json
5970
asset_name: manifest.json
6071
asset_content_type: application/json

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
node_modules
1010

1111
# main.js in root
12-
/main.js
12+
main.js
13+
14+
build/*
1315

1416
# Exclude sourcemaps
1517
*.map

copy-plugin-files.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const __dirname = dirname(__filename);
77

88
// Configuration for file paths and destinations
99
const filesToCopy = [
10+
{ name: 'main.js', sourceDir: join(__dirname, 'build'), destDir: '../' },
1011
{ name: 'styles.css', sourceDir: join(__dirname, 'src'), destDir: '../' },
1112
{ name: 'manifest.json', sourceDir: __dirname, destDir: '../' }
1213
];

esbuild.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const context = await esbuild.context({
3737
logLevel: "info",
3838
sourcemap: prod ? false : "inline",
3939
treeShaking: true,
40-
outfile: prod ? "build/main.js" : "../main.js",
40+
outfile: "build/main.js",
4141
});
4242

4343
if (prod) {

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "prj",
33
"name": "Prj Plugin",
4-
"version": "0.0.14",
4+
"version": "0.0.15",
55
"minAppVersion": "0.15.0",
66
"description": "Prj Plugin - Project, Document, and Task Management",
77
"author": "M. Passarello",

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "obsidian-sample-plugin",
3-
"version": "0.0.14",
3+
"version": "0.0.15",
44
"description": "Prj Plugin - Project, Document, and Task Management",
55
"main": "main.js",
66
"scripts": {
@@ -9,7 +9,7 @@
99
"version:patch": "\"node bump-version.mjs patch\" && npm run postversion",
1010
"version:minor": "\"node bump-version.mjs minor\" && npm run postversion",
1111
"version:major": "\"node bump-version.mjs major\" && npm run postversion",
12-
"postversion": "npm run build && node copy-plugin-files.mjs release && git add manifest.json versions.json package.json ./build/main.js ./build/manifest.json ./build/styles.css"
12+
"postversion": "npm run build && node copy-plugin-files.mjs release && git add manifest.json versions.json package.json"
1313
},
1414
"keywords": [],
1515
"author": "",

versions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
"0.0.11": "0.15.0",
88
"0.0.12": "0.15.0",
99
"0.0.13": "0.15.0",
10-
"0.0.14": "0.15.0"
10+
"0.0.14": "0.15.0",
11+
"0.0.15": "0.15.0"
1112
}

0 commit comments

Comments
 (0)