-
Notifications
You must be signed in to change notification settings - Fork 7
97 lines (85 loc) · 3.14 KB
/
updater.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
name: Reflex Updater
on:
workflow_call:
workflow_dispatch:
push:
paths:
- reflex_updater/**
env:
CARGO_TERM_COLOR: always
GH_TOKEN: '${{ github.token }}'
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
ACTIONSECRET: ${{ secrets.ACTIONSECRET }}
jobs:
build:
name: Build
strategy:
matrix:
target: [ armv7-unknown-linux-musleabihf, x86_64-unknown-linux-musl]
host: [ ubuntu-latest ]
cross: [ true ]
include:
- target: x86_64-apple-darwin
host: macos-latest
cross: false
- target: x86_64-pc-windows-msvc
host: windows-latest
cross: false
runs-on: ${{ matrix.host }}
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- run: cargo install cross --git https://github.com/cross-rs/cross
if: ${{ matrix.cross }}
- run: cross build --release --target ${{ matrix.target }}
if: ${{ matrix.cross }}
working-directory: reflex_updater
- run: cargo build --release --target ${{ matrix.target }}
if: ${{ !matrix.cross }}
working-directory: reflex_updater
#- name: Sign
# if: ${{ matrix.host == 'macos-latest' && env.MACOS_CERTIFICATE_PWD != '' }}
# run: |
# echo $MACOS_CERTIFICATE_PWD | base64 --decode > certificate.pwd
# echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
# version=0.22.0
# release="apple-codesign-${version}-x86_64-apple-darwin"
# tag="apple-codesign/$version"
# asset="${release}.tar.gz"
# gh release download --repo=github.com/indygreg/apple-platform-rs "$tag" --pattern "$asset"
# tar --extract --directory . --strip-components 1 --file "$asset" "${release}"/rcodesign
# ./rcodesign sign --p12-file certificate.p12 --p12-password-file certificate.pwd reflex_updater/target/${{ matrix.target }}/release/reflex_updater
- uses: actions/upload-artifact@v3
if: ${{ matrix.host == 'windows-latest' }}
with:
name: ${{ matrix.target }}
path: |
reflex_updater/target/${{ matrix.target }}/release/reflex_updater.exe
reflex_updater/target/${{ matrix.target }}/release/reflex_updater.pdb
if-no-files-found: error
- uses: actions/upload-artifact@v3
if: ${{ matrix.host != 'windows-latest' }}
with:
name: ${{ matrix.target }}
path: reflex_updater/target/${{ matrix.target }}/release/reflex_updater
if-no-files-found: error
bundle:
name: Bundle
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -lR
working-directory: artifacts
- name: Upload
uses: actions/upload-artifact@v3
with:
name: reflex_updater
path: artifacts/
if-no-files-found: error