Build libwallets #390
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 |