-
-
Notifications
You must be signed in to change notification settings - Fork 17
89 lines (74 loc) · 2.31 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: build & deploy
on:
push:
branches: [ "master" ]
tags:
- "v*"
paths:
- ".github/workflows/**/*"
- "packages/**/*"
- "package.json"
- "pnpm-lock.yaml"
pull_request:
paths:
- "packages/**/*"
- "package.json"
- "pnpm-lock.yaml"
concurrency:
group: build-${{ github.sha }}
cancel-in-progress: true
permissions:
contents: write
jobs:
build:
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
runs-on: ${{ matrix.os }}
name: "build for ${{ matrix.os }}"
steps:
- name: 🛎️ - Checkout
uses: actions/checkout@v3
- name: 📐 - Define variables (1)
if: github.event_name == 'pull_request'
id: set-pr-sha
shell: bash
run: echo "SHORT_PR_SHA=$(git rev-parse HEAD | cut -c 1-7)" >> "$GITHUB_OUTPUT"
- name: 🛠️ - Install Node
uses: actions/setup-node@v3
with: { node-version: 20.11.1 }
- name: 🛠️ - Install Rust
uses: moonrepo/setup-rust@v1
with: {
components: clippy,
channel: '1.77.0'
}
- name: 🛠️ - Install Deps
run: npm install -g pnpm@^8 && pnpm install --frozen-lockfile
- name: 📦 - Build (windows)
if: ${{ matrix.os == 'windows-latest' }}
run: pnpm build:win
- name: 📦 - Build (linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: pnpm build:linux
- name: 🚀 - Upload artifacts for windows
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/upload-artifact@v4
with: {
name: "tosu-windows-${{ steps.set-pr-sha.outputs.SHORT_PR_SHA || github.ref_name }}",
path: packages/tosu/dist/tosu.exe
}
- name: 🚀 - Upload artifacts for linux
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/upload-artifact@v4
with: {
name: "tosu-linux-${{ steps.set-pr-sha.outputs.SHORT_PR_SHA || github.ref_name }}",
path: packages/tosu/dist/tosu
}
# - name: 🚀 - Upload artifacts for mac
# if: matrix.os == 'macos-latest'
# uses: actions/upload-artifact@v3
# with: {
# name: "${{ steps.set-artifact-name.outputs.ARTIFACT_NAME }}",
# path: packages/tosu/dist/tosu.exe
# }