Skip to content

Commit add9524

Browse files
authored
Merge pull request #134 from aminya/release [skip ci]
2 parents 61313e3 + 2785bdd commit add9524

8 files changed

+162
-70
lines changed

.github/workflows/CI.yml

+40-10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- master
77
- main
88
- dev
9+
tags:
10+
- "*"
911

1012
jobs:
1113
Test:
@@ -23,7 +25,7 @@ jobs:
2325
- macos-12
2426
- macos-11
2527
node:
26-
- 14 # installed on the images
28+
- 16
2729
pnpm:
2830
- 7
2931
cache_reset_counter:
@@ -57,29 +59,57 @@ jobs:
5759
run: |
5860
pnpm install
5961
62+
# - name: Setup SSH debugging session
63+
# uses: mxschmitt/action-tmate@v3
64+
65+
- name: Test
66+
if: "!contains(github.event.head_commit.message, '[skip ci test]')"
67+
run: |
68+
pnpm run test
69+
continue-on-error: ${{ contains(matrix.os, 'ubuntu-18.04') }}
70+
6071
# Create self-contained executable that bundles Nodejs
6172
- name: Create Executable
62-
if: "contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-20.04') || contains(matrix.os, 'macos-11')"
73+
if: "contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-22.04') || contains(matrix.os, 'macos-12')"
6374
run: |
6475
pnpm run pack.exe
6576
66-
- name: Upload Executable
67-
if: "contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-20.04') || contains(matrix.os, 'macos-11')"
77+
- name: Upload Artifacts
78+
if: ${{ (startsWith(github.ref, 'refs/tags/')) && contains(matrix.os, 'windows-2022') || contains(matrix.os, 'ubuntu-22.04') || contains(matrix.os, 'macos-12') }}
6879
uses: actions/upload-artifact@v3
6980
with:
7081
path: |
7182
./exe
7283
./dist
7384
retention-days: 1
7485

75-
# - name: Setup SSH debugging session
76-
# uses: mxschmitt/action-tmate@v3
86+
Release:
87+
needs: Test
88+
if: startsWith(github.ref, 'refs/tags/')
89+
runs-on: ubuntu-22.04
90+
steps:
91+
- name: Download Artifacts
92+
uses: actions/download-artifact@v3
7793

78-
- name: Test
79-
if: "!contains(github.event.head_commit.message, '[skip ci test]')"
94+
- name: Place Artifacts
8095
run: |
81-
pnpm run test
82-
continue-on-error: ${{ contains(matrix.os, 'ubuntu-18.04') }}
96+
mv -v artifact/* ./
97+
chmod +x -R ./exe/
98+
99+
- name: Draft the release
100+
uses: meeDamian/[email protected]
101+
with:
102+
token: ${{ secrets.GITHUB_TOKEN }}
103+
gzip: folders
104+
draft: true
105+
files: >
106+
./exe/setup_cpp_windows.exe
107+
./exe/setup_cpp_linux
108+
./exe/setup_cpp_mac
109+
./dist/node12/setup_cpp.js
110+
./dist/node12/setup_cpp.js.map
111+
./dist/node12/
112+
./dist/node16/
83113
84114
Docker:
85115
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip docker]') }}

dev/scripts/pack-exe.js dev/scripts/pack-exe.ts

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { exec } = require("@actions/exec")
1+
import { node } from "execa"
22

33
function getPlatformName() {
44
switch (process.platform) {
@@ -26,13 +26,19 @@ function main() {
2626

2727
return Promise.all(
2828
exes.map((exe) =>
29-
exec(
30-
`./node_modules/.bin/caxa --input ./dist/node16 --output ./exe/setup_cpp_${getPlatformName()}${exe} -- "{{caxa}}/node_modules/.bin/node${exe}" "{{caxa}}/setup_cpp.js"`
31-
)
29+
node("./node_modules/caxa/build/index.mjs", [
30+
"--input",
31+
"./dist/node16",
32+
"--output",
33+
`./exe/setup_cpp_${getPlatformName()}${exe}`,
34+
"--",
35+
`{{caxa}}/node_modules/.bin/node${exe}`,
36+
`{{caxa}}/setup_cpp.js`,
37+
])
3238
)
3339
)
3440
}
3541

36-
main().then((exit) => {
37-
process.exit(exit)
42+
main().catch((err) => {
43+
throw err
3844
})

dev/scripts/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}

ignored-error-codes.json

-1
This file was deleted.

loosely-type-checked-files.json

-1
This file was deleted.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"lint.cspell": "cspell lint --no-progress --show-suggestions",
3333
"lint.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/ --fix",
3434
"lint.prettier": "prettier --write .",
35-
"lint.tsc": "tsc --noEmit | loose-ts-check",
36-
"pack.exe": "shx rm -rf ./dist/tsconfig.tsbuildinfo && node ./dev/scripts/pack-exe.js",
35+
"lint.tsc": "tsc --noEmit",
36+
"pack.exe": "shx rm -rf ./dist/tsconfig.tsbuildinfo && ts-node --esm ./dev/scripts/pack-exe.ts",
3737
"prepare": "pnpm run -r build && pnpm run -w build",
3838
"start.docker": "docker run -t setup_cpp .",
3939
"start.docker.arch": "docker run -t setup_cpp:arch .",
@@ -88,7 +88,6 @@
8888
"eslint-config-atomic": "^1.18.1",
8989
"gen-readme": "^1.6.0",
9090
"jest": "^29.2.1",
91-
"loose-ts-check": "^1.2.0",
9291
"npm-check-updates": "^16.3.14",
9392
"npm-run-all2": "^6.0.2",
9493
"parcel": "2.7.0",
@@ -98,6 +97,7 @@
9897
"shx": "0.3.4",
9998
"terser-config-atomic": "^0.1.1",
10099
"ts-jest": "^29.0.3",
100+
"ts-node": "^10.9.1",
101101
"ts-readme": "^1.1.3",
102102
"typescript": "^4.8.4"
103103
},

0 commit comments

Comments
 (0)