-
Notifications
You must be signed in to change notification settings - Fork 2
138 lines (116 loc) · 3.67 KB
/
tip.yml
File metadata and controls
138 lines (116 loc) · 3.67 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
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
name: Tip (Nightly)
on:
push:
branches:
- main
permissions:
contents: write
# Only run one tip release at a time to prevent corrupting release artifacts.
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
setup:
runs-on: ubuntu-latest
outputs:
commit: ${{ steps.info.outputs.commit }}
commit_long: ${{ steps.info.outputs.commit_long }}
steps:
- uses: actions/checkout@v4
- name: Extract build info
id: info
run: |
echo "commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "commit_long=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
source:
needs: [setup]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create source archive
run: |
git archive --format=zip --prefix=snipp-${{ needs.setup.outputs.commit }}/ HEAD \
-o snipp-source.zip
- name: Upload source archive
uses: actions/upload-artifact@v4
with:
name: source
path: snipp-source.zip
build-macos:
needs: [setup]
strategy:
fail-fast: false
matrix:
include:
- args: '--target aarch64-apple-darwin'
arch: 'silicon'
- args: '--target x86_64-apple-darwin'
arch: 'intel'
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin,x86_64-apple-darwin
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: Install dependencies
run: npm install
- name: Build frontend
run: npm run build
- name: Build Tauri app (${{ matrix.arch }})
run: npm run tauri:build -- ${{ matrix.args }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dmg-${{ matrix.arch }}
path: src-tauri/target/*/release/bundle/dmg/*.dmg
tag:
needs: [setup, build-macos, source]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Force-update tip tag
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -fa tip -m "Latest Continuous Release" ${GITHUB_SHA}
git push --force origin tip
release:
needs: [setup, build-macos, source, tag]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Update tip release
uses: softprops/action-gh-release@v2
with:
tag_name: tip
target_commitish: ${{ github.sha }}
name: 'Snipp Tip ("Nightly")'
prerelease: true
body: |
This tip release is automatically built on every commit to main.
**Warning: This is a nightly build, not a tagged release.**
Built from commit: ${{ needs.setup.outputs.commit_long }}
**Apple Silicon** (M1+): `Snipp_*_aarch64.dmg` | **Intel**: `Snipp_*_x64.dmg`
After installing, remove the quarantine flag:
```
xattr -d com.apple.quarantine /Applications/Snipp.app
```
files: |
artifacts/**/*.dmg
artifacts/snipp-source.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}