This repository has been archived by the owner on May 5, 2022. It is now read-only.
102 lines (87 loc) · 3.15 KB
/
master.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
name: webclient-master
on:
push:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install Node.js, NPM and Yarn
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install and build Angular
run: |
npm install
npm run build
version=$(node -p "require('./package.json').version")
cp dist/index.html dist/404.html
sed -i -e "s/#WEBCLIENT_VERSION#/${version}/" dist/README.md
index_hash=$(openssl dgst -sha256 dist/index.html | awk '{print $NF}')
sed -i -e "s/#INDEX_HASH#/${index_hash}/" dist/README.md
- name: Tag release and publish to gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
version=$(node -p "require('./package.json').version")
git config --global user.email "support@ctemplar.com"
git config --global user.name "CTemplar"
git tag v${version}
git push --tags
git checkout -B gh-pages
git add -f dist
git commit -am "Release v${version}"
git filter-branch -f --prune-empty --subdirectory-filter dist
git push -f origin gh-pages
git checkout -
- name: Publish to Iceland server
run: |
${{ secrets.DEPLOY_COMMAND }} webclient-master
- name: Check out Git repository
uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url:
git@codeberg.org:CTemplar/webclient.git
ssh_private_key:
${{ secrets.CODEBERG_SSH_PRIVATE_KEY }}
pre-release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Install Node.js, NPM and Yarn
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Prepare for app notarization
if: startsWith(matrix.os, 'macos')
# Import Apple API key for app notarization on macOS
run: |
mkdir -p ~/private_keys/
echo '${{ secrets.api_key }}' > ~/private_keys/AuthKey_${{ secrets.api_key_id }}.p8
- name: Build and pre-release Electron apps
uses: samuelmeuli/action-electron-builder@v1
env:
# macOS notarization API key
API_KEY_ID: ${{ secrets.api_key_id }}
API_KEY_ISSUER_ID: ${{ secrets.api_key_issuer_id }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_script_name: 'build:electron'
release: true
mac_certs: ${{ secrets.mac_certs }}
mac_certs_password: ${{ secrets.mac_certs_password }}