-
Notifications
You must be signed in to change notification settings - Fork 12
55 lines (55 loc) · 1.74 KB
/
ci.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
name: CI
on: [ push, pull_request ]
jobs:
rustfmt:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: rustup
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
runs-on: windows-2022
steps:
- name: checkout
uses: actions/checkout@v4
- name: rustup
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- run: cargo clippy --all-targets -- -D warnings
build:
runs-on: windows-2022
steps:
- name: checkout
uses: actions/checkout@v4
- name: rustup
uses: dtolnay/rust-toolchain@stable
- run: cargo install cargo-wix
- run: cargo wix --nocapture
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: package
path: target/wix/*.msi
- name: publish to gh-releases
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: target/wix/*.msi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: publish to chocolatey.org
if: startsWith(github.ref, 'refs/tags/')
run: .\choco-publish.ps1 ${env:GITHUB_REF} ${env:CHOCOLATEY_APIKEY}
env:
CHOCOLATEY_APIKEY: ${{ secrets.CHOCOLATEY_APIKEY }}
- name: publish to WinGet
if: startsWith(github.ref, 'refs/tags/')
run: .\winget-publish.ps1 ${env:GITHUB_REF} ${env:GH_PERSONAL_TOKEN}
env:
# We cannot use GITHUB_TOKEN here because it doesn't have permission to work with winget-pkgs repository fork
GH_PERSONAL_TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }}