-
Notifications
You must be signed in to change notification settings - Fork 0
157 lines (137 loc) · 5.38 KB
/
release.yml
File metadata and controls
157 lines (137 loc) · 5.38 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Release
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
release_id: ${{ steps.create-release.outputs.id }}
release_upload_url: ${{ steps.create-release.outputs.upload_url }}
new_version: ${{ steps.version-bump.outputs.new_version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Read current version
id: read-version
run: |
CURRENT_VERSION=$(jq -r '.version' src-tauri/tauri.conf.json)
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
echo "Current version: $CURRENT_VERSION"
- name: Check if tag already exists
id: check-tag
run: |
CURRENT_VERSION="${{ steps.read-version.outputs.current_version }}"
if git rev-parse "v$CURRENT_VERSION" >/dev/null 2>&1; then
echo "tag_exists=true" >> $GITHUB_OUTPUT
echo "Tag v$CURRENT_VERSION already exists"
else
echo "tag_exists=false" >> $GITHUB_OUTPUT
echo "Tag v$CURRENT_VERSION does not exist"
fi
- name: Bump version
id: version-bump
if: steps.check-tag.outputs.tag_exists == 'false'
run: |
CURRENT_VERSION="${{ steps.read-version.outputs.current_version }}"
# Split version and increment patch
NEW_VERSION=$(echo $CURRENT_VERSION | awk -F. '{print $1"."$2"."$3+1}')
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "New version: $NEW_VERSION"
- name: Update tauri.conf.json
if: steps.check-tag.outputs.tag_exists == 'false'
run: |
NEW_VERSION="${{ steps.version-bump.outputs.new_version }}"
jq --arg new_version "$NEW_VERSION" '.version = $new_version' src-tauri/tauri.conf.json > src-tauri/tauri.conf.json.tmp
mv src-tauri/tauri.conf.json.tmp src-tauri/tauri.conf.json
- name: Update package.json
if: steps.check-tag.outputs.tag_exists == 'false'
run: |
NEW_VERSION="${{ steps.version-bump.outputs.new_version }}"
jq --arg new_version "$NEW_VERSION" '.version = $new_version' package.json > package.json.tmp
mv package.json.tmp package.json
- name: Commit version bump
if: steps.check-tag.outputs.tag_exists == 'false'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
NEW_VERSION="${{ steps.version-bump.outputs.new_version }}"
git add src-tauri/tauri.conf.json package.json
git commit -m "chore: bump version to v$NEW_VERSION [skip ci]"
- name: Create and push tag
if: steps.check-tag.outputs.tag_exists == 'false'
run: |
NEW_VERSION="${{ steps.version-bump.outputs.new_version }}"
git tag "v$NEW_VERSION"
git push origin "v$NEW_VERSION"
- name: Push version bump commit
if: steps.check-tag.outputs.tag_exists == 'false'
run: |
git push origin main
- name: Create Release
id: create-release
if: steps.check-tag.outputs.tag_exists == 'false'
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.version-bump.outputs.new_version }}
name: Prasaran v${{ steps.version-bump.outputs.new_version }}
body: |
## Prasaran v${{ steps.version-bump.outputs.new_version }}
Lightweight stream viewer for Facebook Live and YouTube Live.
Designed for OBS Window Capture on low-power hardware.
### Downloads
- **Windows**: `.msi` installer or `.exe` setup
- **macOS**: `.dmg` disk image
- **Linux**: `.deb`, `.rpm`, or `.AppImage`
build-tauri:
needs: release
if: needs.release.outputs.new_version != ''
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: ubuntu-22.04
args: ''
- platform: windows-latest
args: ''
- platform: macos-latest
args: '--target aarch64-apple-darwin'
- platform: macos-latest
args: '--target x86_64-apple-darwin'
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: v${{ needs.release.outputs.new_version }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Install dependencies (Ubuntu)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install frontend dependencies
run: npm ci
- name: Build Tauri app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseId: ${{ needs.release.outputs.release_id }}
args: ${{ matrix.args }}