-
Notifications
You must be signed in to change notification settings - Fork 4
115 lines (99 loc) · 3.07 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
name: Release
permissions:
contents: write
on:
push:
tags:
- v[0-9]+.*
jobs:
build-assets:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Linux
if: matrix.os == 'ubuntu-latest'
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-3-dev libxdo-dev libappindicator3-dev
version: 1.0
- name: Setup Windows
if: matrix.os == 'windows-latest'
run: |
dotnet tool install --global wix
$base64Cert = '${{ secrets.WINDOWS_CERT }}'
[System.IO.File]::WriteAllBytes("certificate.pfx", [System.Convert]::FromBase64String($base64Cert))
$password = ConvertTo-SecureString -String '${{ secrets.WINDOWS_CERT_PASSWORD }}' -Force -AsPlainText
Import-PfxCertificate -FilePath 'certificate.pfx' -CertStoreLocation 'Cert:\\CurrentUser\\My' -Password $password
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Build binary
run: |
cargo build --release
- name: Install cargo-packager
run: |
cargo install cargo-packager --locked
- name: Package binary
run: |
cargo packager --release -v
- name: Upload windows artifacts
uses: actions/upload-artifact@v4
if: matrix.os == 'windows-latest'
with:
name: windows_packages
path: |
target/packages/*.msi
target/packages/*.exe
- name: Upload linux artifacts
uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest'
with:
name: linux_packages
path: |
target/packages/*.deb
target/packages/*.tar.gz
- name: Upload macos artifacts
uses: actions/upload-artifact@v4
if: matrix.os == 'macos-latest'
with:
name: macos_packages
path: |
target/packages/*.dmg
upload-assets:
needs: build-assets
runs-on: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}
- name: Download Artifact
uses: actions/download-artifact@v4
- name: Release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}
body: |
${{ steps.changelog.outputs.changes }}
files: |
windows_packages/*
linux_packages/*
macos_packages/*
draft: false
prerelease: false