-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (84 loc) · 2.61 KB
/
release-desktop.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
name: CD Desktop Binaries
on:
workflow_dispatch:
inputs:
build_name:
description: "A custom version name. The resulting name will have the format <cargo.version.patch>-<custom-name>-<rev> (E.g. 1.0.23-custom-name-2eb68d8c)."
required: false
type: string
push:
tags:
- "**"
branches:
- main
permissions:
id-token: write
contents: write
packages: write
env:
CARGO_TERM_COLOR: always
MACHINE: ubuntu-latest
jobs:
build:
strategy:
matrix:
build-target:
- runner: ubuntu-latest
toolchain: x86_64-unknown-linux-gnu
binary: libsargon_uniffi.so
- runner: macos-15-xlarge
toolchain: aarch64-apple-darwin
binary: libsargon_uniffi.dylib
runs-on: ${{ matrix.build-target.runner }}
env:
RUST_TOOLCHAIN: nightly-2024-07-30
RUST_COMPONENTS: "rust-std"
steps:
- uses: RDXWorks-actions/checkout@main
- name: Install Rust Toolchain
uses: RDXWorks-actions/toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: ${{ env.RUST_COMPONENTS }}
target: ${{ matrix.build-target.toolchain }}
default: 'true'
- name: Set up JDK 17
uses: RDXWorks-actions/setup-java@v3
with:
distribution: "adopt"
java-version: "17"
- name: Build desktop binaries
uses: RDXWorks-actions/gradle-build-action@main
with:
arguments: sargon-android:buildCargoDesktopRelease
build-root-directory: jvm
- name: Upload Artifacts
uses: RDXWorks-actions/upload-artifact@main
with:
name: ${{ matrix.build-target.toolchain }}
path: "target/${{ matrix.build-target.toolchain }}/release/${{ matrix.build-target.binary }}"
if-no-files-found: error
publish:
needs: build
runs-on: ubuntu-latest
env:
CUSTOM_BUILD_NAME: ${{ inputs.build_name }}
steps:
- uses: RDXWorks-actions/checkout@main
- uses: RDXWorks-actions/download-artifact@main
with:
path: artifacts
- name: Set up JDK 17
uses: RDXWorks-actions/setup-java@v3
with:
distribution: "adopt"
java-version: "17"
- name: Prune Tags
run: git fetch --prune --tags
- name: Publish desktop binaries
uses: RDXWorks-actions/gradle-build-action@main
with:
arguments: sargon-android:publishDesktopReleasePublicationToGitHubPackagesRepository
build-root-directory: jvm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}