generated from sarioglu/svelte-tailwindcss-template
-
Notifications
You must be signed in to change notification settings - Fork 4
141 lines (118 loc) · 3.9 KB
/
alpha-matrix.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: 💀 Alpha build
on:
push:
tags:
- "v[12].[0-9]+.[0-9]+-alpha*"
jobs:
profile-cloud-build:
runs-on: ubuntu-latest
steps:
- name: Checkout Profile Cloud repository
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.PROFILE_CLOUD_KEY }}
repository: intechstudio/profile-cloud
fetch-depth: 0
- name: Checkout latest tag
run: git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
- name: Create public env file
run: |
touch .env
echo PUBLIC_COMMIT_HASH=$(git log --format="%h" -n 1) >> .env
echo PUBLIC_APP_ENV=development >> .env
echo PUBLIC_GOOGLE_CLIENT_ID=${{ secrets.PUBLIC_GOOGLE_CLIENT_ID_DEV }} >> .env
echo PUBLIC_CREATION_DATE=$(git log --format="%cd" --date=format:'%Y-%m-%d' -1) >> .env
- name: Build profile cloud project
run: npm ci && npm run build
- name: Upload profile cloud folder
uses: actions/upload-artifact@v4
with:
name: profile-cloud
path: public/
retention-days: 1
matrix-build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
needs: profile-cloud-build
steps:
- uses: actions/checkout@v3
with:
ref: ""
submodules: true
- name: Setup NodeJs
uses: actions/setup-node@v3
with:
node-version: "18.16.1"
- name: Download profile cloud artifact
uses: actions/download-artifact@v4
with:
name: profile-cloud
path: profile-cloud/
# WORKFLOW_NAME is used for productName extension in electron-builder.js
- name: Set Env
shell: bash
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
echo "WORKFLOW_NAME=alpha" >> $GITHUB_ENV
- name: Install dependencies
run: npm i
- name: Update package.json
run: node ./build-scripts/alpha-packageModifier.js
- name: Build
run: npm run export:alpha
if: ${{ always() }}
env:
# gh repo token
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# windows Code signing
WIN_CSC_LINK: ${{ secrets.WIN_CSC_LINK }}
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
# Apple ID
APPLE_ID: ${{secrets.APPLE_ID}}
APPLE_TEAM_ID: ${{secrets.APPLE_TEAM_ID}}
APPLE_APP_SPECIFIC_PASSWORD: ${{secrets.APPLE_APP_SPECIFIC_PASSWORD}}
# macOS Code signing
CSC_LINK: ${{ secrets.MAC_CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.MAC_CSC_KEY_PASSWORD }}
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.RELEASE_VERSION }}
name: Release ${{ env.RELEASE_VERSION }}
files: build/*.*
draft: false
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
linux-unit-test:
name: Linux Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ""
submodules: true
- name: Setup nodeJS
uses: actions/setup-node@v3
with:
node-version: "18.16.1"
- name: Install dependencies
run: npm i
- name: "Run unit tests"
run: |
npm test >> unit_test.txt
cat unit_test.txt
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: linux-unit-test
path: unit_test.txt
- uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_DEV_WEBHOOK }}
content: "Heyo, here are the editor unit test results!"
filename: "unit_test.txt"