Skip to content

Commit b660967

Browse files
authored
ci: update workflow (#40)
* ci: update workflow * fix: use local checkout sha * ci: update * ci: oh god i forget that we runs on windows, instead of linux... * ci: add prettier ci check * ci: again... windows... why... kill me plz... * ci: fck windows again
1 parent 5c7f153 commit b660967

File tree

4 files changed

+50
-8
lines changed

4 files changed

+50
-8
lines changed

.github/workflows/deploy.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@ name: Build and Deploy
33
on:
44
push:
55
branches:
6-
- '*'
6+
- 'master'
77
tags:
8-
- '*'
8+
- 'v*'
99
pull_request:
10-
branches:
11-
- '*'
1210

1311
concurrency:
14-
group: build-${{ github.ref_name }}
12+
group: build-${{ github.sha }}
1513
cancel-in-progress: true
1614

1715
permissions:
@@ -30,6 +28,13 @@ jobs:
3028
- name: Checkout 🛎️
3129
uses: actions/checkout@v3
3230

31+
- name: Set output pr sha
32+
if: github.event_name == 'pull_request'
33+
id: set-pr-sha
34+
shell: bash
35+
run: |
36+
echo "SHORT_PR_SHA=$(git rev-parse HEAD | cut -c 1-7)" >> "$GITHUB_OUTPUT"
37+
3338
- name: Install Node.js 🔧
3439
uses: actions/setup-node@v3
3540
with:
@@ -68,5 +73,5 @@ jobs:
6873
if: startsWith( matrix.os, 'windows' )
6974
uses: actions/upload-artifact@v3
7075
with:
71-
name: ${{ matrix.os }}-${{ github.ref_name }}
76+
name: tosu-${{ matrix.os }}-${{ steps.set-pr-sha.outputs.SHORT_PR_SHA || github.ref_name }}
7277
path: packages/tosu/dist/tosu.exe

.github/workflows/pr_lint.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: PR-check
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
group: lint-${{ github.sha }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
lint:
12+
#runs-on: ubuntu-latest
13+
runs-on: windows-latest
14+
steps:
15+
- name: Checkout 🛎️
16+
uses: actions/checkout@v3
17+
18+
- name: Install Node.js 🔧
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: 18
22+
23+
- name: Install Rust 🔧
24+
uses: ATiltedTree/setup-rust@v1
25+
with:
26+
rust-version: stable
27+
components: clippy
28+
29+
- name: Install Deps 🔧
30+
run: |
31+
npm install -g pnpm@^8
32+
pnpm install --frozen-lockfile
33+
34+
- name: Lint PR
35+
run: |
36+
pnpm run prettier:ci

.prettierrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"trailingComma": "none",
88
"quoteProps": "as-needed",
99
"bracketSpacing": true,
10-
"endOfLine": "lf",
10+
"endOfLine": "auto",
1111
"plugins": ["@trivago/prettier-plugin-sort-imports"],
1212
"importOrderSeparation": true,
1313
"importOrderSortSpecifiers": true,

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"start": "pnpm run -C packages/tosu run:dev",
88
"build": "pnpm run -C packages/tosu compile",
99
"release": "standard-version",
10-
"prettier:fix": "prettier --write \"**/*.{js,jsx,ts,tsx,css,scss}\""
10+
"prettier:fix": "prettier --write \"**/*.{js,jsx,ts,tsx,css}\"",
11+
"prettier:ci": "prettier --check \"**/*.{js,jsx,ts,tsx,css}\""
1112
},
1213
"dependencies": {
1314
"@types/node": "^18.14.6",

0 commit comments

Comments
 (0)