Skip to content

Commit

Permalink
Problem: No automatic release workflow in github actions (#60)
Browse files Browse the repository at this point in the history
Solution: Added github workflow to publish binaries and dynamic libraries to release assets whenever a new release is created.
  • Loading branch information
devashishdxt authored Aug 26, 2021
1 parent 4bb1b4a commit 8575c1a
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 67 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release

on:
push:
tags:
- "v*.*.*"

jobs:
build:
name: Release
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Get version
id: get_version
uses: battila7/get-version-action@v2
- name: Make release folder
run: mkdir -p ./release/${{ matrix.os }}
- name: Prepare release on ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
cp ./target/release/libmnemonic_signer.so ./release/${{ matrix.os }}/
cp ./target/release/libstdout_logger.so ./release/${{ matrix.os }}/
cp ./target/release/solo-machine ./release/${{ matrix.os }}/
tar -C ./release/${{ matrix.os }}/ -czvf ./release/${{ matrix.os }}-${{ steps.get_version.outputs.version }}.tar.gz .
- name: Prepare release on macos
if: matrix.os == 'macos-latest'
run: |
cp ./target/release/libmnemonic_signer.dylib ./release/${{ matrix.os }}/
cp ./target/release/libstdout_logger.dylib ./release/${{ matrix.os }}/
cp ./target/release/solo-machine ./release/${{ matrix.os }}/
tar -C ./release/${{ matrix.os }}/ -czvf ./release/${{ matrix.os }}-${{ steps.get_version.outputs.version }}.tar.gz .
- name: Prepare release on windows
if: matrix.os == 'windows-latest'
run: |
cp ./target/release/libmnemonic_signer.dll ./release/${{ matrix.os }}/
cp ./target/release/libstdout_logger.dll ./release/${{ matrix.os }}/
cp ./target/release/solo-machine.exe ./release/${{ matrix.os }}/
Compress-Archive -Path ./release/${{ matrix.os }}/* -DestinationPath ./release/${{ matrix.os }}-${{ steps.get_version.outputs.version }}.zip
- name: Cleanup
run: rm -r ./release/${{ matrix.os }}
- name: Publish release assets
uses: softprops/action-gh-release@v1
with:
files: ./release/*
122 changes: 56 additions & 66 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion solo-machine-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ anyhow = "1.0.43"
async-trait = "0.1.51"
bech32 = "0.8.1"
chrono = "0.4.19"
cosmos-sdk-proto = "0.6.2"
cosmos-sdk-proto = "0.6.3"
ed25519-dalek = "1.0.1"
hex = { version = "0.4.3", features = ["serde"] }
k256 = { version = "0.9.6", features = ["ecdsa"] }
Expand Down

0 comments on commit 8575c1a

Please sign in to comment.