Repository navigation
70 lines (60 loc) · 2 KB
/
Copy pathbuild-snap.yml
File metadata and controls
70 lines (60 loc) · 2 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
name: Build Snap package
on:
workflow_dispatch:
inputs:
publish:
description: Upload to the Snap Store (stable channel)
type: boolean
default: false
pull_request:
paths:
- .github/workflows/build-snap.yml
- app/**
- src/**
- package.json
- package-lock.json
permissions:
contents: read
jobs:
snap:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: 22.15.0
cache: npm
cache-dependency-path: |
package-lock.json
app/package-lock.json
- name: Install CLI dependencies
run: npm ci
- name: Install desktop dependencies
run: npm ci --prefix app
- name: Build snap
run: npm --prefix app run package:snap
- name: Upload snap artifact
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: CodeBurn-Snap
path: app/release/codeburn_*.snap
if-no-files-found: error
retention-days: 14
publish:
needs: snap
if: github.event_name == 'workflow_dispatch' && inputs.publish
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: CodeBurn-Snap
- name: Publish to Snap Store
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
run: |
sudo snap install snapcraft --classic
# snapcraft exits 1 when the store queues the revision for manual review,
# which every personal-files snap does; the upload itself succeeded.
snapcraft upload --release=stable codeburn_*.snap 2>&1 | tee upload.log
test "${PIPESTATUS[0]}" -eq 0 || grep -q 'will need manual review' upload.log