2323
2424
2525 steps :
26- - uses : actions/checkout@v4
26+ - uses : actions/checkout@v6
2727
2828 - name : Rust Setup
2929 id : setup
4343 sudo apt-get install -qq -y gcc-aarch64-linux-gnu
4444 fi
4545
46+ - name : Set up Python for PR validation
47+ if : github.event_name == 'pull_request' && matrix.target == 'x86_64-unknown-linux-gnu'
48+ uses : actions/setup-python@v6
49+ with :
50+ python-version : ' 3.11'
51+ cache : ' pip'
52+ cache-dependency-path : ' scripts/requirements.txt'
53+
54+ - name : Validate release script syntax without running scripts
55+ if : github.event_name == 'pull_request' && matrix.target == 'x86_64-unknown-linux-gnu'
56+ env :
57+ PYTHONPYCACHEPREFIX : ${{ runner.temp }}/znotify-python-cache
58+ run : python -m py_compile scripts/version.py scripts/winget.py
59+
60+ - name : Test CLI on native host
61+ if : startsWith(matrix.target, 'x86_64-')
62+ run : cargo test --locked --bins
63+
4664 - name : Build binary
4765 run : |
48- cargo build --release --bins --target ${{ matrix.target }}
66+ cargo build --locked -- release --bins --target ${{ matrix.target }}
4967 cargo deb --target ${{ matrix.target }}
5068
5169
5573 mv -f target/${{ matrix.target }}/release/znotify target/${{ matrix.target }}/release/znotify-${{ matrix.target }}
5674
5775 - name : Upload artifact
58- uses : actions/upload-artifact@v4
76+ uses : actions/upload-artifact@v6
5977 with :
6078 name : ${{ matrix.target }}
6179 path : |
7189 - aarch64-apple-darwin
7290
7391 steps :
74- - uses : actions/checkout@v4
92+ - uses : actions/checkout@v6
7593
7694 - name : Rust Setup
7795 id : setup
@@ -86,17 +104,21 @@ jobs:
86104 run : |
87105 rustup target add ${{ matrix.target }}
88106
107+ - name : Test CLI on native host
108+ if : startsWith(matrix.target, 'x86_64-')
109+ run : cargo test --locked --bins
110+
89111 - name : Build binary
90112 run : |
91- cargo build --release --bins --target ${{ matrix.target }}
113+ cargo build --locked -- release --bins --target ${{ matrix.target }}
92114
93115 - name : Rename binary
94116 shell : bash
95117 run : |
96118 mv -f target/${{ matrix.target }}/release/znotify target/${{ matrix.target }}/release/znotify-${{ matrix.target }}
97119
98120 - name : Upload artifact
99- uses : actions/upload-artifact@v4
121+ uses : actions/upload-artifact@v6
100122 with :
101123 name : ${{ matrix.target }}
102124 path : target/${{ matrix.target }}/release/znotify-${{ matrix.target }}
@@ -111,7 +133,7 @@ jobs:
111133 - aarch64-pc-windows-msvc
112134
113135 steps :
114- - uses : actions/checkout@v4
136+ - uses : actions/checkout@v6
115137
116138 - name : Rust Setup
117139 id : setup
@@ -126,17 +148,21 @@ jobs:
126148 run : |
127149 rustup target add ${{ matrix.target }}
128150
151+ - name : Test CLI on native host
152+ if : startsWith(matrix.target, 'x86_64-')
153+ run : cargo test --locked --bins
154+
129155 - name : Build binary
130156 run : |
131- cargo build --release --bins --target ${{ matrix.target }}
157+ cargo build --locked -- release --bins --target ${{ matrix.target }}
132158
133159 - name : Rename binary
134160 shell : bash
135161 run : |
136162 mv -f target/${{ matrix.target }}/release/znotify.exe target/${{ matrix.target }}/release/znotify-${{ matrix.target }}.exe
137163
138164 - name : Upload artifact
139- uses : actions/upload-artifact@v4
165+ uses : actions/upload-artifact@v6
140166 with :
141167 name : ${{ matrix.target }}
142168 path : target/${{ matrix.target }}/release/znotify-${{ matrix.target }}.exe
@@ -188,11 +214,11 @@ jobs:
188214 needs : [ build_binary_linux, build_binary_macos, build_binary_windows ]
189215 runs-on : ubuntu-latest
190216 steps :
191- - uses : actions/checkout@v4
217+ - uses : actions/checkout@v6
192218 with :
193219 ref : ' master'
194220
195- - uses : actions/setup-python@v5
221+ - uses : actions/setup-python@v6
196222 with :
197223 python-version : ' 3.11'
198224 cache : ' pip'
0 commit comments