File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -213,16 +213,16 @@ jobs:
213213 VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)
214214 echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
215215
216- - name : Initialize and Build MSI
216+ - name : Build MSI
217+ shell : pwsh
217218 run : |
218- cargo wix init --force
219- cargo wix --nocapture --target x86_64-pc-windows-msvc
219+ ./packaging/windows/build-msi.ps1 -Version "${{ steps.version.outputs.VERSION }}" -Target "x86_64-pc-windows-msvc"
220220
221221 - name : Upload MSI
222222 uses : actions/upload-artifact@v4
223223 with :
224224 name : NEWM-Admin-${{ steps.version.outputs.VERSION }}-windows.msi
225- path : newm-admin/target/wix/* .msi
225+ path : newm-admin/target/x86_64-pc-windows-msvc/release/NEWM-Admin-${{ steps.version.outputs.VERSION }}-windows .msi
226226
227227 # Release job uploads all packaged artifacts to GitHub Releases
228228 release :
Original file line number Diff line number Diff line change 11[package ]
22name = " newm-admin"
3- version = " 0.1.0 "
3+ version = " 0.1.1 "
44edition = " 2024"
5+ authors = [" Andrew Westberg <awestberg@newm.io>" ]
6+ license = " Apache-2.0"
7+ license-file = " ../LICENSE"
58
69[dependencies ]
710# GUI Framework
Original file line number Diff line number Diff line change 66//! Uses async reqwest with async-compat for Tokio compatibility
77//! within GPUI's async executor.
88
9+ use crate :: http_client;
910use reqwest:: Client ;
1011use serde:: { Deserialize , Serialize } ;
1112use std:: fmt;
@@ -133,7 +134,7 @@ impl AuthClient {
133134 /// Create a new authentication client
134135 pub fn new ( ) -> Self {
135136 Self {
136- client : Client :: new ( ) ,
137+ client : http_client :: new_client ( ) ,
137138 }
138139 }
139140
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ use async_compat::Compat;
66use reqwest:: Client ;
77use serde:: { Deserialize , Serialize } ;
88
9+ use crate :: http_client;
910use crate :: session:: { Session , SessionError } ;
1011
1112/// Request to add royalties to a song
@@ -81,7 +82,7 @@ impl EarningsClient {
8182 /// Create a new earnings client
8283 pub fn new ( ) -> Self {
8384 Self {
84- client : Client :: new ( ) ,
85+ client : http_client :: new_client ( ) ,
8586 }
8687 }
8788
Original file line number Diff line number Diff line change 1+ //! Shared HTTP client configuration for NEWM Admin.
2+ //!
3+ //! Studio traffic is fronted by an AWS load balancer that rejects requests without a non-empty
4+ //! `User-Agent` header (returns an HTML 403). To keep behavior consistent across environments,
5+ //! we configure a default `User-Agent` for all outbound reqwest requests.
6+
7+ use reqwest:: { Client , header} ;
8+
9+ const USER_AGENT : & str = concat ! ( "newm-admin/" , env!( "CARGO_PKG_VERSION" ) ) ;
10+
11+ pub fn new_client ( ) -> Client {
12+ Client :: builder ( )
13+ . default_headers ( {
14+ let mut headers = header:: HeaderMap :: new ( ) ;
15+ headers. insert (
16+ header:: USER_AGENT ,
17+ header:: HeaderValue :: from_static ( USER_AGENT ) ,
18+ ) ;
19+ headers
20+ } )
21+ . build ( )
22+ . expect ( "Failed to build reqwest client" )
23+ }
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ mod auth;
33mod colors;
44mod csv_import;
55mod earnings;
6+ mod http_client;
67mod jwt;
78mod session;
89mod toast;
Original file line number Diff line number Diff line change 55
66use async_compat:: Compat ;
77use gpui:: * ;
8- use reqwest:: Client ;
98use std:: sync:: { Arc , Mutex } ;
109
1110use crate :: auth:: { Environment , LoginResponse } ;
11+ use crate :: http_client;
1212use crate :: jwt;
1313
1414/// Session state containing authentication tokens
@@ -82,7 +82,7 @@ impl Session {
8282 tracing:: info!( "Access token expires soon, refreshing..." ) ;
8383
8484 // Need to refresh - use the refresh token
85- let client = Client :: new ( ) ;
85+ let client = http_client :: new_client ( ) ;
8686 let url = self . environment . refresh_url ( ) ;
8787
8888 let response = Compat :: new ( async {
You can’t perform that action at this time.
0 commit comments