forked from tari-project/tari
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (101 loc) · 3.36 KB
/
build_libwallets.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
name: Build libwallets
'on':
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
branches:
- "build-libwallet-*"
schedule:
- cron: "05 00 * * *"
workflow_dispatch:
inputs:
build_android:
type: boolean
default: true
build_ios:
type: boolean
default: true
toolchain:
type: string
description: 'Rust toolchain'
env:
toolchain_default: nightly-2022-05-01
jobs:
builds_envs_setup:
runs-on: ubuntu-latest
outputs:
toolchain: ${{ steps.envs_setup.outputs.toolchain }}
build_android: ${{ steps.envs_setup.outputs.build_android }}
build_ios: ${{ steps.envs_setup.outputs.build_ios }}
steps:
- name: envs setup
id: envs_setup
run: |
TOOLCHAIN=${{ github.event.inputs.toolchain }}
echo "toolchain=${TOOLCHAIN:-${{ env.toolchain_default }}}" >> $GITHUB_OUTPUT
BUILD_ANDROID=${{ github.event.inputs.build_android }}
echo "build_android=${BUILD_ANDROID:-true}" >> $GITHUB_OUTPUT
BUILD_IOS=${{ github.event.inputs.build_ios }}
echo "build_ios=${BUILD_IOS:-true}" >> $GITHUB_OUTPUT
builds_run:
needs: builds_envs_setup
uses: ./.github/workflows/build_libwallets_workflow.yml
with:
toolchain: ${{ needs.builds_envs_setup.outputs.toolchain }}
build_android: ${{ needs.builds_envs_setup.outputs.build_android }}
build_ios: ${{ needs.builds_envs_setup.outputs.build_ios }}
libwallet_uploads:
needs: builds_run
runs-on: ubuntu-latest
steps:
- name: Download binaries
uses: actions/download-artifact@v3
with:
path: libwallets
- name: Verify checksums
shell: bash
working-directory: libwallets
run: |
ls -alhtR
find . -name "*.sha256sums" -type f -print | xargs cat >> libwallets.txt.sha256sums-verify
cat libwallets.txt.sha256sums-verify
sha256sum -c libwallets.txt.sha256sums-verify
- name: Sync to S3 on tag
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
continue-on-error: true # Don't break if s3 upload fails
uses: jakejarvis/[email protected]
with:
args: --acl public-read --follow-symlinks
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: "us-east-1" # optional: defaults to us-east-1
SOURCE_DIR: "$GITHUB_WORKSPACE/libwallets"
DEST_DIR: "libwallet"
create-release:
runs-on: ubuntu-latest
needs: libwallet_uploads
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
steps:
- name: Download binaries
uses: actions/download-artifact@v3
with:
path: libwallets
# - name: Setup changelog
# shell: bash
# working-directory: libwallets
# run: |
# find . -name changelog.md -type f -exec cp -vf {} "$GITHUB_WORKSPACE/" \;
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: "libwallet*/**/*"
token: ${{ secrets.GITHUB_TOKEN }}
#bodyFile: "changelog.md"
prerelease: true
draft: true
allowUpdates: true
updateOnlyUnreleased: true
replacesArtifacts: true