-
-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (136 loc) · 4.88 KB
/
release.yml
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
name: Release
on:
release:
types: [created]
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-20.04
target: x86_64-unknown-linux-musl
- build: macos-x86_64
os: macos-11
target: x86_64-apple-darwin
- build: macos-aarch64
os: macos-14
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@b4ffde65f46336ab88eb53be808477a3936bae11
# - name: Install packages (Ubuntu)
# if: matrix.os == 'ubuntu-20.04'
# run: |
# sudo apt-get update
# sudo apt-get install -y --no-install-recommends xz-utils liblz4-tool musl-tools
- name: Install Rust
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
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@8f032eff0255912cc9c8455797fd6d72f25c7ab7 # v1.7.5
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:
# TODO: Make this more consistent with the other binary
platform: [macos-latest, ubuntu-20.04, windows-latest]
include:
- platform: macos-latest
os: darwin
- platform: ubuntu-20.04
os: linux # TODO: musl?
- platform: windows-latest
os: windows-2022
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 21
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: install frontend dependencies
run: npm clean-install
- uses: tauri-apps/tauri-action@v0.5.1
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@8f032eff0255912cc9c8455797fd6d72f25c7ab7 # v1.7.5
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