Repository navigation
72 lines (61 loc) · 1.98 KB
/
Copy pathbuild.yml
File metadata and controls
72 lines (61 loc) · 1.98 KB
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
name: Build SPA
on:
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: "build"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: app
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: app/package-lock.json
- name: Install Dependencies
run: |
npm install -g @quasar/cli
npm ci
- name: Build SPA artifacts
run: |
npm run build
npm run zip:spa
npm run deb:spa
- name: Compute release name
id: version
run: |
VERSION=$(node -p "require('./package.json').version")
API_VERSION=$(node -p "require('./package.json').apiVersion")
RELEASE_NAME="v${VERSION}+api${API_VERSION}"
echo "release_name=$RELEASE_NAME" >> "$GITHUB_OUTPUT"
- name: Check for duplicate release
env:
RELEASE_NAME: ${{ steps.version.outputs.release_name }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git fetch --tags --force
TAG_EXISTS=$(git rev-parse "$RELEASE_NAME" >/dev/null 2>&1 && echo true || echo false)
RELEASE_EXISTS=$(gh release view "$RELEASE_NAME" >/dev/null 2>&1 && echo true || echo false)
if [ "$TAG_EXISTS" = "true" ] && [ "$RELEASE_EXISTS" = "true" ]; then
echo "::error::Release $RELEASE_NAME already exists. Run 'cd app && npm version <patch|minor|major>' before merging to main."
exit 1
fi
- name: Publish release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.release_name }}
name: ${{ steps.version.outputs.release_name }}
files: |
app/dist/spa.zip
app/dist/*.deb