-
-
Notifications
You must be signed in to change notification settings - Fork 3
140 lines (128 loc) · 4.61 KB
/
Copy pathrelease.yml
File metadata and controls
140 lines (128 loc) · 4.61 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:
release:
types: [published]
permissions: read-all
env:
CARGO_INCREMENTAL: 0
jobs:
publish-web:
name: build-release
permissions:
contents: write
strategy:
fail-fast: false
matrix:
build: [linux-musl, macos-x86_64, macos-aarch64, win-msvc]
include:
- build: linux-musl
os: ubuntu-22.04
target: x86_64-unknown-linux-musl
- build: macos-x86_64
os: macos-15-intel
target: x86_64-apple-darwin
- build: macos-aarch64
os: macos-15
target: aarch64-apple-darwin
- build: win-msvc
os: windows-2022
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Install Rust
uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Build release binary
run: cargo build --target ${{ matrix.target }} --verbose --release -p diffedit3
- name: Build archive
shell: bash
run: |
# TODO: Create a third action to combine both in one archive
outdir="target/${{ matrix.target }}/release"
name="diffedit3-${{ github.event.release.tag_name }}-${{ matrix.target }}"
cd "$outdir"
ls # Debug
if [ "${{ matrix.os }}" = "windows-2022" ]; then
7z a "../../../$name.zip" diffedit3.exe
echo "ASSET=$name.zip" >> $GITHUB_ENV
else
tar czf "../../../$name.tar.gz" diffedit3
echo "ASSET=$name.tar.gz" >> $GITHUB_ENV
fi
- name: Upload release archive
uses: shogo82148/actions-upload-release-asset@59cbc563d11314e48122193f8fe5cdda62ea6cf9 # v1.9.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.ASSET }}
asset_name: ${{ env.ASSET }}
asset_content_type: application/octet-stream
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-22.04, windows-latest]
include:
- platform: macos-latest
os: darwin
- platform: ubuntu-22.04
os: linux # Unlike the -web binary, this is not -musl (and cannot be, statically linked Tauri makes no sense)
- platform: windows-latest
os: windows-2022
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v5
- name: setup node
uses: actions/setup-node@v5
with:
node-version: 21
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: ./.github/scripts/ubuntu_install_tauri_dependencies.sh
- name: install frontend dependencies
run: npm clean-install
- uses: tauri-apps/tauri-action@v0.5.23
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Will publish a release manually
# with:
# tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
# releaseName: "App v__VERSION__"
# releaseBody: "See the assets to download this version and install."
# releaseDraft: true
# prerelease: false
- name: Build archive
shell: bash
run: |
# TODO: Create a third action to combine both in one archive
outdir="target/release"
name="diffedit3-unsupported-tauri-gui-${{ github.event.release.tag_name }}-${{ matrix.os }}"
cd "$outdir"
ls # Debug
if [ "${{ matrix.os }}" = "windows-2022" ]; then
7z a "../../$name.zip" diffedit3-gui.exe
echo "ASSET=$name.zip" >> $GITHUB_ENV
else
tar czf "../../$name.tar.gz" diffedit3-gui
echo "ASSET=$name.tar.gz" >> $GITHUB_ENV
fi
cd ../..
ls
- name: Upload release archive
uses: shogo82148/actions-upload-release-asset@59cbc563d11314e48122193f8fe5cdda62ea6cf9 # v1.9.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.ASSET }}
asset_name: ${{ env.ASSET }}
asset_content_type: application/octet-stream