Skip to content

Commit e7c4fff

Browse files
committed
ci: initial progress to make workflows prod-ready
1 parent c66b952 commit e7c4fff

File tree

5 files changed

+81
-29
lines changed

5 files changed

+81
-29
lines changed

.github/workflows/pr.yml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,52 @@ on:
66
- synchronize
77
- ready_for_review
88

9+
name: Label, Build & Lint PR
10+
911
jobs:
10-
build:
12+
autolabel:
13+
uses: Navigraph/workflows/.github/workflows/autolabel.yml@main
14+
secrets: inherit
15+
16+
filter:
17+
name: Register changed paths
18+
if: ${{ !github.event.pull_request.draft && !contains(github.event.pull_request.labels.*.name , 'release') }}
19+
runs-on: ubuntu-latest
20+
outputs:
21+
js-interface: ${{ steps.changes.outputs.js-interface }}
22+
example: ${{ steps.changes.outputs.example }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: dorny/paths-filter@v2
26+
id: changes
27+
with:
28+
filters: |
29+
js-interface:
30+
- 'src/js/**'
31+
32+
lint:
33+
name: Lint 📝
34+
runs-on: ubuntu-latest
35+
needs: [filter]
36+
if: ${{ needs.filter.outputs.js-interface == 'true' && !github.event.pull_request.draft && !contains(github.event.pull_request.labels.*.name , 'release') }}
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- uses: actions/setup-node@v4
41+
with:
42+
node-version: "18"
43+
cache: "npm"
44+
45+
- name: Install node modules
46+
run: npm ci
47+
48+
- name: Run linting
49+
run: npm run lint:js -- -- --max-warnings 0
50+
51+
build-test:
52+
name: Build & test 🛠️
1153
runs-on: ubuntu-latest
54+
if: ${{ !github.event.pull_request.draft && !contains(github.event.pull_request.labels.*.name , 'release') }}
1255
steps:
1356
- name: Checkout
1457
uses: actions/checkout@v4

.github/workflows/pre-release.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,44 @@ on:
55
- "v*-alpha*"
66
- "v*-beta*"
77

8+
name: Create pre-release
9+
run-name: Create pre-release for `${{ github.ref_name }}`
10+
811
jobs:
9-
build:
12+
release-wasm:
1013
runs-on: ubuntu-latest
1114
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
16+
1417
- name: Build WASM module
1518
run: npm run build:wasm-workflow
19+
1620
- name: Pre-Release
1721
uses: softprops/action-gh-release@v1
1822
with:
1923
files: ./out/msfs_navdata_interface.wasm
2024
prerelease: true
25+
generate_release_notes: true
26+
27+
# Enable in future to automate publishing of NPM package
28+
# release-js:
29+
# runs-on: ubuntu-latest
30+
# steps:
31+
# - uses: actions/checkout@v4
32+
33+
# - uses: actions/setup-node@v4
34+
# with:
35+
# node-version: "18"
36+
# registry-url: 'https://registry.npmjs.org'
37+
# cache: "npm"
38+
39+
# - name: Install node modules
40+
# run: npm ci
41+
42+
# - name: Build JS Interface
43+
# run: cd src/js && npm run build
44+
45+
# - name: Publish to NPM
46+
# env:
47+
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
48+
# run: cd src/js && npm publish --tag next

.github/workflows/push.yml

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

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,20 @@ on:
55
- "!v*-rc*"
66
- "!v*-alpha*"
77
- "!v*-beta*"
8+
9+
name: Create release
10+
run-name: Create release for `${{ github.ref_name }}`
811

912
jobs:
1013
build:
1114
runs-on: ubuntu-latest
1215
steps:
1316
- name: Checkout
1417
uses: actions/checkout@v2
18+
1519
- name: Build WASM module
1620
run: npm run build:wasm-workflow
21+
1722
- name: Release
1823
uses: softprops/action-gh-release@v1
1924
with:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
],
66
"scripts": {
77
"format": "prettier --write .",
8-
"lint": "eslint --ext ts,tsx .",
8+
"lint:js": "eslint \"src/js/**/*.ts\"",
99
"build:wasm": ".\\scripts\\build.bat",
1010
"build:wasm-workflow": "./scripts/run_docker_cmd.sh ./scripts/build.sh",
1111
"jest": "jest --verbose",

0 commit comments

Comments
 (0)