forked from searleser97/graphite-cli
-
Notifications
You must be signed in to change notification settings - Fork 3
124 lines (119 loc) · 3.86 KB
/
push.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Push CI
permissions:
contents: write
on:
push:
branches: [main]
tags:
- "v*"
jobs:
lint_and_fast_tests:
name: 'Run CLI tests'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 15.x, 16.x, 17.x, 18.x, current]
steps:
# Basic setup
- uses: actions/checkout@v3
with:
clean: 'false'
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: yarn install --immutable
- name: Build
run: yarn turbo run build
- name: Setup git
run: git config --global user.email "test@gmail.com" && git config --global user.name "test"
- name: Git Version
run: git --version
- name: Test
run: yarn workspace @withgraphite/graphite-cli run test
superlinter:
name: 'Run superlinter'
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: Lint Code Base
uses: github/super-linter@v4
continue-on-error: true
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TYPESCRIPT_DEFAULT_STYLE: prettier
create-binaries:
name: Upload executable binaries
strategy:
matrix:
os: [windows, macos, ubuntu]
include:
- os: windows
build: yarn workspace @withgraphite/graphite-cli run build-pkg -t node16-win -o "gt-win-${{ github.sha }}" --debug
artifact-name: gt-win-${{ github.sha }}.exe
artifact-path: apps\cli\gt-win-${{ github.sha }}.exe
- os: macos
build: yarn workspace @withgraphite/graphite-cli run build-pkg -t node16-macos -o "gt-macos-${{ github.sha }}"
artifact-name: gt-macos-${{ github.sha }}
artifact-path: apps/cli/gt-macos-${{ github.sha }}
- os: ubuntu
build: yarn workspace @withgraphite/graphite-cli run build-pkg -t node16-linux -o "gt-linux-${{ github.sha }}"
artifact-name: gt-linux-${{ github.sha }}
artifact-path: apps/cli/gt-linux-${{ github.sha }}
runs-on: ${{ matrix.os }}-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install
run: yarn install --immutable
- name: Build
run: yarn turbo run build
- name: Build binary
run: ${{ matrix.build }}
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact-name }}
path: ${{ matrix.artifact-path }}
release:
name: Release version
if: startsWith(github.ref, 'refs/tags/v')
needs: [lint_and_fast_tests, create-binaries]
runs-on: ubuntu-latest
steps:
- name: Download windows
uses: actions/download-artifact@v3
with:
name: gt-win-${{ github.sha }}.exe
- name: Download mac
uses: actions/download-artifact@v3
with:
name: gt-macos-${{ github.sha }}
- name: Download linux
uses: actions/download-artifact@v3
with:
name: gt-linux-${{ github.sha }}
- name: Rename files
run: |
mv gt-win-${{ github.sha }}.exe gt-win.exe;
mv gt-macos-${{ github.sha }} gt-macos;
mv gt-linux-${{ github.sha }} gt-linux
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: "gt-win.exe,gt-macos,gt-linux"
draft: false
prerelease: true
allowUpdates: true