-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (121 loc) · 4.15 KB
/
release.yml
File metadata and controls
140 lines (121 loc) · 4.15 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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
create-release:
name: Create Release
runs-on: ubuntu-22.04
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Check if release already exists
id: release_exists
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if gh release view "${{ github.ref_name }}" >/dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
- name: Create GitHub Release
id: create_release
if: steps.release_exists.outputs.exists != 'true'
uses: softprops/action-gh-release@v2
with:
name: CSV Align ${{ github.ref_name }}
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-release:
name: Build Release
needs: create-release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
artifact_name: csv-align-linux-x86_64
asset_name: csv-align-linux-x86_64
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: csv-align-macos-arm64
asset_name: csv-align-macos-arm64
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: csv-align-macos-x86_64
asset_name: csv-align-macos-x86_64
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install frontend dependencies
working-directory: frontend
run: npm ci
- name: Build frontend
working-directory: frontend
run: npm run build
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
. -> target
src-tauri -> src-tauri/target
key: tauri-${{ matrix.os }}-${{ matrix.target }}
- name: Install Tauri CLI
run: cargo install tauri-cli --locked --version "^2" --force
- name: Build Tauri app
working-directory: src-tauri
run: |
rm -rf target/${{ matrix.target }}/release/bundle
cargo tauri build --target ${{ matrix.target }}
- name: Upload Linux packages
if: matrix.os == 'ubuntu-22.04'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: |
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb
src-tauri/target/x86_64-unknown-linux-gnu/release/bundle/appimage/*.AppImage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload macOS ARM package
if: matrix.os == 'macos-latest' && matrix.target == 'aarch64-apple-darwin'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/*.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload macOS Intel package
if: matrix.os == 'macos-latest' && matrix.target == 'x86_64-apple-darwin'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: src-tauri/target/x86_64-apple-darwin/release/bundle/dmg/*.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}