@@ -13,28 +13,31 @@ jobs:
1313 publish :
1414 strategy :
1515 matrix :
16+ build : [linux-x86_64, windows-x86, windows-x86_64, windows-aarch64]
1617 include :
17- - build : linux-x86
18+ - build : linux-x86_64
1819 os : ubuntu-latest
1920 target : x86_64-unknown-linux-gnu
2021 - build : windows-x86
22+ os : windows-latest
23+ target : i686-pc-windows-msvc
24+ msvc_arch : amd64_x86
25+ - build : windows-x86_64
2126 os : windows-latest
2227 target : x86_64-pc-windows-msvc
23- # - build: windows-i686
24- # os: windows-latest
25- # target: i686-pc-windows-msvc
26- # - build: windows-aarch64
27- # os: windows-latest
28- # target: aarch64-pc-windows-msvc
29- # - build: macos-x86
30- # os: macos-latest
31- # target: x86_64-apple-darwin
32- - build : macos-aarch64
33- os : macos-latest
34- target : aarch64-apple-darwin
28+ msvc_arch : amd64
29+ - build : windows-aarch64
30+ os : windows-latest
31+ target : aarch64-pc-windows-msvc
32+ msvc_arch : amd64_arm64
3533 runs-on : ${{ matrix.os }}
3634 steps :
3735 - uses : actions/checkout@v4
36+ - name : Install C toolchain (Windows)
37+ if : runner.os == 'Windows'
38+ uses : ilammy/msvc-dev-cmd@v1
39+ with :
40+ arch : ${{ matrix.msvc_arch }}
3841 - name : Install packages (Linux)
3942 if : runner.os == 'Linux'
4043 uses : awalsh128/cache-apt-pkgs-action@v1.4.3
5356 with :
5457 toolchain : stable
5558 - uses : Swatinem/rust-cache@v2
59+ with :
60+ key : ${{ matrix.build }}
5661 - run : rustup target add ${{ matrix.target }}
5762 # Build the CLI only binary
5863 - run : cargo build --no-default-features --release --target ${{ matrix.target }}
@@ -76,12 +81,124 @@ jobs:
7681 MAVEN_URL : ${{ secrets.NEW_MAVEN_URL }}
7782 MAVEN_USERNAME : ${{ secrets.NEW_MAVEN_USERNAME }}
7883 MAVEN_PASSWORD : ${{ secrets.NEW_MAVEN_PASSWORD }}
84+ SNAPSHOTS_URL : ${{ secrets.NEW_MAVEN_SNAPSHOT_URL }}
85+ SNAPSHOTS_USERNAME : ${{ secrets.NEW_MAVEN_SNAPSHOT_USERNAME }}
86+ SNAPSHOTS_PASSWORD : ${{ secrets.NEW_MAVEN_SNAPSHOT_PASSWORD }}
7987 TARGET : ${{ matrix.target }}
8088 OS : ${{ matrix.build }}
89+ publish_macos :
90+ runs-on : ubuntu-latest
91+ container : ghcr.io/rust-cross/cargo-zigbuild:0.20
92+ steps :
93+ - uses : actions/checkout@v4
94+ - uses : actions/setup-java@v4
95+ with :
96+ distribution : " microsoft"
97+ java-version : " 21"
98+ cache : " gradle"
99+ - uses : gradle/actions/wrapper-validation@v3
100+ - name : Install Rust
101+ uses : dtolnay/rust-toolchain@stable
102+ with :
103+ toolchain : stable
104+ - uses : Swatinem/rust-cache@v2
105+ - run : rustup target add aarch64-apple-darwin
106+ - run : rustup target add x86_64-apple-darwin
107+ # Build the CLI only binary
108+ - run : cargo zigbuild --no-default-features --release --target universal2-apple-darwin
109+ - name : Rename CLI Binaries
110+ run : |
111+ mv "target/aarch64-apple-darwin/release/ornithe-installer-rs" "target/aarch64-apple-darwin/release/ornithe-installer-rs-cli.bin"
112+ mv "target/x86_64-apple-darwin/release/ornithe-installer-rs" "target/x86_64-apple-darwin/release/ornithe-installer-rs-cli.bin"
113+ mv "target/universal2-apple-darwin/release/ornithe-installer-rs" "target/universal2-apple-darwin/release/ornithe-installer-rs-cli.bin"
114+ # Regular build with GUI
115+ - run : cargo zigbuild --release --target universal2-apple-darwin
116+ - name : Rename Binaries
117+ run : |
118+ mv "target/aarch64-apple-darwin/release/ornithe-installer-rs" "target/aarch64-apple-darwin/release/ornithe-installer-rs.bin"
119+ mv "target/x86_64-apple-darwin/release/ornithe-installer-rs" "target/x86_64-apple-darwin/release/ornithe-installer-rs.bin"
120+ mv "target/universal2-apple-darwin/release/ornithe-installer-rs" "target/universal2-apple-darwin/release/ornithe-installer-rs.bin"
121+ - uses : actions/upload-artifact@v4
122+ with :
123+ name : Artifacts macos
124+ path : |
125+ target/**/release/ornithe-installer-rs*
126+ !target/**/ornithe-installer-rs.d
127+ !target/**/build/
128+ - run : ./gradlew publish --stacktrace
129+ env :
130+ MAVEN_URL : ${{ secrets.NEW_MAVEN_URL }}
131+ MAVEN_USERNAME : ${{ secrets.NEW_MAVEN_USERNAME }}
132+ MAVEN_PASSWORD : ${{ secrets.NEW_MAVEN_PASSWORD }}
133+ SNAPSHOTS_URL : ${{ secrets.NEW_MAVEN_SNAPSHOT_URL }}
134+ SNAPSHOTS_USERNAME : ${{ secrets.NEW_MAVEN_SNAPSHOT_USERNAME }}
135+ SNAPSHOTS_PASSWORD : ${{ secrets.NEW_MAVEN_SNAPSHOT_PASSWORD }}
136+ TARGET : aarch64-apple-darwin
137+ OS : macos-aarch64
138+ - run : ./gradlew publish --stacktrace
139+ env :
140+ MAVEN_URL : ${{ secrets.NEW_MAVEN_URL }}
141+ MAVEN_USERNAME : ${{ secrets.NEW_MAVEN_USERNAME }}
142+ MAVEN_PASSWORD : ${{ secrets.NEW_MAVEN_PASSWORD }}
143+ SNAPSHOTS_URL : ${{ secrets.NEW_MAVEN_SNAPSHOT_URL }}
144+ SNAPSHOTS_USERNAME : ${{ secrets.NEW_MAVEN_SNAPSHOT_USERNAME }}
145+ SNAPSHOTS_PASSWORD : ${{ secrets.NEW_MAVEN_SNAPSHOT_PASSWORD }}
146+ TARGET : x86_64-apple-darwin
147+ OS : macos-x86_64
148+ - run : ./gradlew publish --stacktrace
149+ env :
150+ MAVEN_URL : ${{ secrets.NEW_MAVEN_URL }}
151+ MAVEN_USERNAME : ${{ secrets.NEW_MAVEN_USERNAME }}
152+ MAVEN_PASSWORD : ${{ secrets.NEW_MAVEN_PASSWORD }}
153+ SNAPSHOTS_URL : ${{ secrets.NEW_MAVEN_SNAPSHOT_URL }}
154+ SNAPSHOTS_USERNAME : ${{ secrets.NEW_MAVEN_SNAPSHOT_USERNAME }}
155+ SNAPSHOTS_PASSWORD : ${{ secrets.NEW_MAVEN_SNAPSHOT_PASSWORD }}
156+ TARGET : universal2-apple-darwin
157+ OS : macos-universal2
158+ publish_linux_cross :
159+ strategy :
160+ matrix :
161+ build : [linux-aarch64]
162+ include :
163+ - build : linux-aarch64
164+ target : aarch64-unknown-linux-gnu
165+ runs-on : ubuntu-latest
166+ steps :
167+ - uses : actions/checkout@v4
168+ - uses : actions/setup-java@v4
169+ with :
170+ distribution : " microsoft"
171+ java-version : " 21"
172+ cache : " gradle"
173+ - uses : gradle/actions/wrapper-validation@v3
174+ - name : Install Rust
175+ uses : dtolnay/rust-toolchain@stable
176+ with :
177+ toolchain : stable
178+ - uses : Swatinem/rust-cache@v2
179+ with :
180+ key : linux-cross
181+ - run : cargo install cross --git https://github.com/cross-rs/cross
182+ # Build the CLI only binary
183+ - run : cross build --no-default-features --release --target ${{ matrix.target }}
184+ - run : mv "target/${{ matrix.target }}/release/ornithe-installer-rs" "target/${{ matrix.target }}/release/ornithe-installer-rs-cli.bin"
185+ # Regular build with GUI
186+ - run : cross build --release --target ${{ matrix.target }}
187+ - run : mv "target/${{ matrix.target }}/release/ornithe-installer-rs" "target/${{ matrix.target }}/release/ornithe-installer-rs.bin"
188+ - uses : actions/upload-artifact@v4
189+ with :
190+ name : Artifacts ${{ matrix.target }}
191+ path : |
192+ target/${{ matrix.target }}/release/ornithe-installer-rs*
193+ !target/**/ornithe-installer-rs.d
194+ !target/**/build/
81195 - run : ./gradlew publish --stacktrace
82196 env :
197+ MAVEN_URL : ${{ secrets.NEW_MAVEN_URL }}
198+ MAVEN_USERNAME : ${{ secrets.NEW_MAVEN_USERNAME }}
199+ MAVEN_PASSWORD : ${{ secrets.NEW_MAVEN_PASSWORD }}
83200 SNAPSHOTS_URL : ${{ secrets.NEW_MAVEN_SNAPSHOT_URL }}
84201 SNAPSHOTS_USERNAME : ${{ secrets.NEW_MAVEN_SNAPSHOT_USERNAME }}
85202 SNAPSHOTS_PASSWORD : ${{ secrets.NEW_MAVEN_SNAPSHOT_PASSWORD }}
86203 TARGET : ${{ matrix.target }}
87- OS : ${{ matrix.build }}
204+ OS : ${{ matrix.build }}
0 commit comments