Skip to content

Commit f516fa7

Browse files
committed
upgrade checkout action, fix build_link
1 parent 0f4c3cc commit f516fa7

6 files changed

Lines changed: 13 additions & 29 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ on:
77

88
jobs:
99
build:
10-
name: build
1110
runs-on: ubuntu-latest
11+
env:
12+
BUILD_LINK: https://github.com/leonhma/obsidian-functionplot/actions/runs/${{ github.run_id }}
1213

1314
steps:
14-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1516

1617
- uses: actions/setup-node@v3
1718
with:
@@ -31,7 +32,7 @@ jobs:
3132
- name: upload dist
3233
uses: actions/upload-artifact@v3.1.0
3334
with:
34-
name: dist
35+
name: obsidian-functionplot
3536
path: |
3637
manifest.json
3738
main.js
@@ -40,7 +41,7 @@ jobs:
4041
runs-on: ubuntu-latest
4142
name: test
4243
steps:
43-
- uses: actions/checkout@v2
44+
- uses: actions/checkout@v3
4445

4546
- uses: actions/setup-node@v3
4647
with:
@@ -56,9 +57,9 @@ jobs:
5657

5758
lint:
5859
runs-on: ubuntu-latest
59-
name: lint:prod
60+
name: lint
6061
steps:
61-
- uses: actions/checkout@v2
62+
- uses: actions/checkout@v3
6263

6364
- uses: actions/setup-node@v3
6465
with:

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ permissions:
1010
jobs:
1111
release:
1212
runs-on: ubuntu-latest
13+
env:
14+
BUILD_LINK: https://github.com/leonhma/obsidian-functionplot/releases/tag/${{ github.event.release.tag_name }}
1315

1416
steps:
1517
- name: Setup Node.js environment
@@ -18,7 +20,7 @@ jobs:
1820
node-version: 18
1921

2022
- name: Checkout
21-
uses: actions/checkout@v2.4.2
23+
uses: actions/checkout@v3
2224

2325
- name: Install
2426
run: |
@@ -42,7 +44,7 @@ jobs:
4244
# build now, so that no side-effects when build fails and release get deleted
4345
- name: Build
4446
run: |
45-
pnpm run build:release
47+
pnpm run build:prod
4648
mkdir obsidian-functionplot
4749
cp main.js manifest.json styles.css obsidian-functionplot
4850
zip -r obsidian-functionplot.zip obsidian-functionplot

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ main.js
33
!*/**/main.js
44
data.json
55
package-lock.json
6+
yarn.lock
67
.nyc_output
78
coverage
89
.yarn

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"license": "MIT",
88
"private": true,
99
"scripts": {
10-
"build:release": "pnpm exec webpack --env production --env includeReleaseLink",
1110
"build:prod": "pnpm exec webpack --env production",
1211
"build": "pnpm exec webpack",
1312
"watch": "pnpm exec webpack --watch",

src/__tests__/utils.test.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

webpack.config.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ const { execSync } = require("child_process");
55

66
module.exports = (env) => {
77
const isProd = env.production === true;
8-
console.log("isProd", isProd);
98
const manifest = JSON.parse(readFileSync("manifest.json", "utf8"));
10-
const isCI = process.env.CI === "true";
11-
console.log("isCI", isCI);
129

1310
return {
1411
mode: isProd ? "production" : "development",
@@ -69,11 +66,7 @@ module.exports = (env) => {
6966
? manifest.version
7067
: `${execSync("git rev-parse --short HEAD").toString().trim()}+`
7168
),
72-
BUILD_LINK: JSON.stringify(
73-
env.includeReleaseLink === true
74-
? `https://github.com/leonhma/obsidian-functionplot/releases/tag/${manifest.version}`
75-
: ""
76-
),
69+
BUILD_LINK: JSON.stringify(process.env.BUILD_LINK || ""),
7770
}),
7871
],
7972
resolve: {

0 commit comments

Comments
 (0)